Curl output from ruby script

Hi
Normally when i do curl i get this
From command line

curl localhost

test

but when i run this from ruby script, i get this

ruby test.rb
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
100 44 100 44 0 0 25042 0 --:–:-- --:–:-- --:–:--
44000

test

why ruby is adding that extra line ??

how can i ommit this

% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
100 44 100 44 0 0 25042 0 --:–:-- --:–:-- --:–:--
44000
??

Thanks for your help.

Ferdous ara wrote in post #1079699:

why ruby is adding that extra line ??

It isn’t. curl is, because you are not running curl at a terminal (or
are redirecting the output). Try this at the terminal:

curl http://www.ruby-lang.org/ >myfile

and you’ll get the same.

Want to know how to get rid of it? Type ‘man curl’


-s/–silent
Silent or quiet mode. Don’t show progress meter or
error mes-
sages. Makes Curl mute.

On Sat, Oct 13, 2012 at 1:41 PM, Ferdous ara [email protected]
wrote:

Hi
Normally when i do curl i get this
From command line

why ruby is adding that extra line ??

how can i ommit this

Use Net::HTTP or Mechanize instead of an external program like curl
for HTTP. Then you have better control about output etc.

Kind regards

robert