In article <E1AKqLF-0001DM-C4 / odie.runbox.com>,
  "T. Onoma" <transami / runbox.com> writes:

> oh i see. other type of procs! okay, hash is better then. do you want me to do it?

No.  I already implemented.  (not committed yet.)

In my version, progress_proc takes two arguments instead of one.
It takes expected total size by Content-Length as second argument if available.

> i had it that way before and i can just put it back. the thing about the proc arguements though, each proc in the hash could take different arguments. hmmm....is is possible for the hash key itself to determine which args to pass in to the proc rather then making up names for them? for instance:
>
> open( url, { pos: proc { |b| ...} } )  # would pass #pos
>
> or something like that. just a thought.

m(x => y) is same as m({x => y}).

> funny you ask, because i keep reading and reading about them, but for some reason i never quite understand them. most tech writers just assume you know, i guess. i sort of know how to use them on command line to pipe output from one command into another. can you more easily explain?

pipe can be used to asynchronous process.

Try:

pipe = IO.popen("while :; do echo a; sleep 1; done")
pipe.each_line {|line| p line }

pipe = IO.popen("wget -q -O- http://raa.ruby-lang.org/all.html")
pipe.each_line {|line| p line }

IO.popen doesn't wait finishing a command.

So, if URI::HTTP#open works like that, you can use it for progress
bar.  But it has subtle differences.
-- 
Tanaka Akira