ruby-changes:21041
From: drbrain <ko1@a...>
Date: Sat, 27 Aug 2011 08:55:55 +0900 (JST)
Subject: [ruby-changes:21041] drbrain:r33090 (ruby_1_9_3): * backport r33087 from trunk.
drbrain 2011-08-27 08:55:45 +0900 (Sat, 27 Aug 2011) New Revision: 33090 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=33090 Log: * backport r33087 from trunk. * lib/open-uri.rb: Fix indentation of OpenURI::OpenRead#open. Use ++ instead of `' for method arguments in open-uri.rb Modified files: branches/ruby_1_9_3/ChangeLog branches/ruby_1_9_3/lib/open-uri.rb Index: ruby_1_9_3/ChangeLog =================================================================== --- ruby_1_9_3/ChangeLog (revision 33089) +++ ruby_1_9_3/ChangeLog (revision 33090) @@ -1,3 +1,10 @@ +Sat Aug 27 07:53:34 2011 Eric Hodel <drbrain@s...> + + * backport r33087 from trunk. + + * lib/open-uri.rb: Fix indentation of OpenURI::OpenRead#open. Use ++ + instead of `' for method arguments in open-uri.rb + Sat Aug 27 07:22:07 2011 Eric Hodel <drbrain@s...> * backport r33086 from trunk. Index: ruby_1_9_3/lib/open-uri.rb =================================================================== --- ruby_1_9_3/lib/open-uri.rb (revision 33089) +++ ruby_1_9_3/lib/open-uri.rb (revision 33090) @@ -526,19 +526,23 @@ # OpenURI::OpenRead#open provides `open' for URI::HTTP and URI::FTP. # # OpenURI::OpenRead#open takes optional 3 arguments as: - # OpenURI::OpenRead#open([mode [, perm]] [, options]) [{|io| ... }] # - # `mode', `perm' is same as Kernel#open. + # OpenURI::OpenRead#open([mode [, perm]] [, options]) [{|io| ... }] # - # However, `mode' must be read mode because OpenURI::OpenRead#open doesn't + # OpenURI::OpenRead#open returns an IO-like object if block is not given. + # Otherwise it yields the IO object and return the value of the block. + # The IO object is extended with OpenURI::Meta. + # + # +mode+ and +perm+ are the same as Kernel#open. + # + # However, +mode+ must be read mode because OpenURI::OpenRead#open doesn't # support write mode (yet). - # Also `perm' is just ignored because it is meaningful only for file - # creation. + # Also +perm+ is ignored because it is meaningful only for file creation. # - # `options' must be a hash. + # +options+ must be a hash. # - # Each option pair with a string key specifies an extra header field for - # HTTP. I.e., it is ignored for FTP without HTTP proxy. + # Each option with a string key specifies an extra header field for HTTP. + # I.e., it is ignored for FTP without HTTP proxy. # # The hash may include other options, where keys are symbols: # @@ -552,22 +556,28 @@ # # If :proxy option is specified, the value should be String, URI, # boolean or nil. + # # When String or URI is given, it is treated as proxy URI. + # # When true is given or the option itself is not specified, # environment variable `scheme_proxy' is examined. # `scheme' is replaced by `http', `https' or `ftp'. + # # When false or nil is given, the environment variables are ignored and # connection will be made to a server directly. # # [:proxy_http_basic_authentication] # Synopsis: - # :proxy_http_basic_authentication => ["http://proxy.foo.com:8000/", "proxy-user", "proxy-password"] - # :proxy_http_basic_authentication => [URI.parse("http://proxy.foo.com:8000/"), "proxy-user", "proxy-password"] + # :proxy_http_basic_authentication => + # ["http://proxy.foo.com:8000/", "proxy-user", "proxy-password"] + # :proxy_http_basic_authentication => + # [URI.parse("http://proxy.foo.com:8000/"), + # "proxy-user", "proxy-password"] # - # If :proxy option is specified, the value should be an Array with 3 elements. - # It should contain a proxy URI, a proxy user name and a proxy password. - # The proxy URI should be a String, an URI or nil. - # The proxy user name and password should be a String. + # If :proxy option is specified, the value should be an Array with 3 + # elements. It should contain a proxy URI, a proxy user name and a proxy + # password. The proxy URI should be a String, an URI or nil. The proxy + # user name and password should be a String. # # If nil is given for the proxy URI, this option is just ignored. # @@ -603,7 +613,7 @@ # # If :progress_proc option is specified, the proc is called with one # argument each time when `open' gets content fragment from network. - # The argument `size' `size' is a accumulated transferred size in bytes. + # The argument +size+ is the accumulated transferred size in bytes. # # If two or more transfer is done by HTTP redirection, the procedure # is called only one for a last transfer. @@ -644,27 +654,25 @@ # # :ssl_verify_mode is used to specify openssl verify mode. # - # OpenURI::OpenRead#open returns an IO-like object if block is not given. - # Otherwise it yields the IO object and return the value of the block. - # The IO object is extended with OpenURI::Meta. - # # [:ftp_active_mode] # Synopsis: # :ftp_active_mode=>bool # - # :ftp_active_mode=>true is used to make ftp active mode. - # Note that the active mode is default in Ruby 1.8 or prior. - # Ruby 1.9 uses passive mode by default. + # <tt>:ftp_active_mode => true</tt> is used to make ftp active mode. + # Ruby 1.9 uses passive mode by default. + # Note that the active mode is default in Ruby 1.8 or prior. # # [:redirect] # Synopsis: # :redirect=>bool # - # :redirect=>false is used to disable all HTTP redirects. - # OpenURI::HTTPRedirect exception raised on redirection. - # It is true by default. - # The true means redirections between http and ftp are permitted. + # +:redirect+ is true by default. <tt>:redirect => false</tt> is used to + # disable all HTTP redirects. # + # OpenURI::HTTPRedirect exception raised on redirection. + # Using +true+ also means that redirections between http and ftp are + # permitted. + # def open(*rest, &block) OpenURI.open_uri(self, *rest, &block) end @@ -672,7 +680,7 @@ # OpenURI::OpenRead#read([options]) reads a content referenced by self and # returns the content as string. # The string is extended with OpenURI::Meta. - # The argument `options' is same as OpenURI::OpenRead#open. + # The argument +options+ is same as OpenURI::OpenRead#open. def read(options={}) self.open(options) {|f| str = f.read -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/