[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Ruby WGet

Marc Heiler

4/9/2009 10:01:00 AM

Hi,

I would need a ruby "wget version" which works on linux and windows.

I would like to feed it an URL to a .tar.bz2 or .zip or .tar.gz file and
have it download. That's what it basically should do.

Right now I use

system 'wget '+the_url

which does not work on windows easily (but will work on pretty much all
the linuxes out there)

I once wrote a minimal ruby wget wrapper but it has some problems as the
code is years old and messy :/ so I was wondering if anyone is using
some ruby-wget thing?
--
Posted via http://www.ruby-....

5 Answers

Robert Klemme

4/9/2009 10:21:00 AM

0

On 09.04.2009 12:00, Marc Heiler wrote:
> I would need a ruby "wget version" which works on linux and windows.
>
> I would like to feed it an URL to a .tar.bz2 or .zip or .tar.gz file and
> have it download. That's what it basically should do.

> I once wrote a minimal ruby wget wrapper but it has some problems as the
> code is years old and messy :/ so I was wondering if anyone is using
> some ruby-wget thing?

It seems Net::HTTP is everything you need, especially since you just
want to download a single file and did not mention other requirements.

Kind regards

robert

Ben Lovell

4/9/2009 10:29:00 AM

0

[Note: parts of this message were removed to make it a legal post.]

On Thu, Apr 9, 2009 at 11:00 AM, Marc Heiler <shevegen@linuxmail.org> wrote:

> Hi,
>
> I would need a ruby "wget version" which works on linux and windows.
>
> I would like to feed it an URL to a .tar.bz2 or .zip or .tar.gz file and
> have it download. That's what it basically should do.
>

Net::HTTP should be adequate, no?

Ben

Matthew Williams

4/9/2009 12:46:00 PM

0

I'd suggest using openuri -- it's a lot more flexible than net::http.

Not to toot my own horn, but I've a version of cat which opens uri's,
files, etc...., which you might consider basing your code upon -- it's at:

http://matthewkwilliams.com/index.php/2008/09/10/cat-on...

(and a followup at)

http://matthewkwilliams.com/index.php/2008/09/11/universal-...

Hope this helps,
Matt

--
"... if you do follow your bliss you put yourself on a kind of
track that has been there all the while, waiting for you, and the life
that you ought to be living is the one you are living. When you can
see that, you begin to meet people who are in your field of bliss, and
they open doors to you. I say, follow your bliss and don't be afraid,
and doors will open where you didn't know they were going to be." --
Joseph Campbell

TRMatt

1/13/2012 2:01:00 AM

0

On Thu, 12 Jan 2012 15:09:08 -0800, 2849 Dead <dead@dead.net> wrote:

>On Thu, 12 Jan 2012 14:32:40 -0800, MattB <trdell1234@gmail.com>
>wrote:
>
>>On Thu, 12 Jan 2012 12:39:25 -0800 (PST), Phlip <phlip2005@gmail.com>
>>wrote:
>>
>>>On Jan 12, 12:20?pm, MattB <trdell1...@gmail.com> wrote:
>>>
>>>> After reading this did some checking and found it not to be totally
>>>> accurate. ?Although as a organization glad it is gone.
>>>
>>>Why? Because poor people can't get free paperwork and legal help
>>>against slum lords?
>>
>> Because it had to much corruption in it. It should have been
>>replaced with something a little less political. Then sadly it would
>>not get the funding I guess.
>
>What corruption?


http://en.wikipedia.org/wiki/Association_of_Community_Organizations_for_...

I've been doing more reading and it seems if they had stayed out
of politics and just helped people things would have been better for
them.


>>

TRMatt

1/13/2012 2:36:00 AM

0

On Fri, 13 Jan 2012 02:19:15 +0000 (UTC), 2849 Dead <dead@gone.com>
wrote:

>On Thu, 12 Jan 2012 18:01:06 -0800, MattB wrote:
>
>> On Thu, 12 Jan 2012 15:09:08 -0800, 2849 Dead <dead@dead.net> wrote:
>>
>>>On Thu, 12 Jan 2012 14:32:40 -0800, MattB <trdell1234@gmail.com> wrote:
>>>
>>>>On Thu, 12 Jan 2012 12:39:25 -0800 (PST), Phlip <phlip2005@gmail.com>
>>>>wrote:
>>>>
>>>>>On Jan 12, 12:20?pm, MattB <trdell1...@gmail.com> wrote:
>>>>>
>>>>>> After reading this did some checking and found it not to be totally
>>>>>> accurate. ?Although as a organization glad it is gone.
>>>>>
>>>>>Why? Because poor people can't get free paperwork and legal help
>>>>>against slum lords?
>>>>
>>>> Because it had to much corruption in it. It should have been
>>>>replaced with something a little less political. Then sadly it would
>>>>not get the funding I guess.
>>>
>>>What corruption?
>>
>>
>> http://en.wikipedia...
>Association_of_Community_Organizations_for_Reform_Now
>>
>> I've been doing more reading and it seems if they had stayed out
>> of politics and just helped people things would have been better for
>> them.
>>
>Yeah, heaven forbid that ordinary people play any role in the political
>process.

LOL they do every day.
>
>Be sure to ask your masters if you'll get a tip for that.

Now you sound just like Richard Steel "my masters". ACORN
no longer exist correct.


>>
>>
>
>
>
>
>
>--
>?Those who make peaceful revolution impossible, make violent revolution
>inevitable? -JFK