From: Keith Fahlgren Date: 2006-11-15T07:47:56+09:00 Subject: Re: Net:HTTP performance downloading large files On 11/14/06, Chad Burt wrote: > Thanks. Found this file: /usr/local/lib/ruby/1.8/net/protocol.rb > and changed > ... > The problem now is that I have a web API client that I was going to > package into a ruby-gem that would have been easy to install. Now I have > to tell people to start hacking the standard library if they want to use > it. Uhhg! With Ruby's open classes, you shouldn't have to. At the top of your file/library/program, just open the class you'd like to modify, in this case the module Net and the class BufferedIO, and do what you want. Something like: module Net class BufferedIO def rbuf_fill timeout(@read_timeout) { #changed by cburt to a much larger buffer for speed @rbuf << @io.sysread(16384) } end end end Note: Modifying the standard library is usually considered bad form, but if you know what you're doing and are explicit about it it's usually ok. HTH, Keith