In article <E1AKn40-0003Sd-8h / fetch-bak.runbox.com>,
  "T. Onoma" <transami / runbox.com> writes:

> hi, i am not familiear with any procedures for submitting changes to a ruby lib, so fogive me if I have not done this correctly. please email me if i need to do something differnetly. thanks.
>
> i have made a small modification to open-uri to allow it to execute a proc in the data fetching loops. this has proved very useful to me in providing a progress reported download. (i used Ruby/ProgressBar).

I don't like the API.

Since there are many ways to control behavior, "first proc argument is
for progress bar" is not intuitive.

How about another API?
open(name, :progress_proc => lambda {|pos| ... })

> Note that in the future it might be nice to get open-uri to work more like a real IO.

open-uri emulates usual file instead of pipe.
I think it should be default at least.

There are many subtle difference between file and pipe:
* various exception by network problem may be raised at (first) read
  time instead of open time.
* pipe is unseekable.
* cannot get actual file size for pipe. (Content-Length may be invalid)
* cannot support rw mode.
* etc.

However optional pipe emulation mode is acceptable, maybe.
-- 
Tanaka Akira