1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/open-uri.rb: Fix indentation of OpenURI::OpenRead#open. Use ++

instead of `' for method arguments in open-uri.rb


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
drbrain 2011-08-26 23:11:38 +00:00
parent ca96541149
commit 164c7dc574
2 changed files with 40 additions and 27 deletions

View file

@ -1,3 +1,8 @@
Sat Aug 27 07:53:34 2011 Eric Hodel <drbrain@segment7.net>
* 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@segment7.net> Sat Aug 27 07:22:07 2011 Eric Hodel <drbrain@segment7.net>
* ext/pathname/lib/pathname.rb: Fix typos and grammar mistakes. Patch * ext/pathname/lib/pathname.rb: Fix typos and grammar mistakes. Patch

View file

@ -526,19 +526,23 @@ module OpenURI
# OpenURI::OpenRead#open provides `open' for URI::HTTP and URI::FTP. # OpenURI::OpenRead#open provides `open' for URI::HTTP and URI::FTP.
# #
# OpenURI::OpenRead#open takes optional 3 arguments as: # OpenURI::OpenRead#open takes optional 3 arguments as:
#
# OpenURI::OpenRead#open([mode [, perm]] [, options]) [{|io| ... }] # OpenURI::OpenRead#open([mode [, perm]] [, options]) [{|io| ... }]
# #
# `mode', `perm' is same as Kernel#open. # 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.
# #
# However, `mode' must be read mode because OpenURI::OpenRead#open doesn't # +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). # support write mode (yet).
# Also `perm' is just ignored because it is meaningful only for file # Also +perm+ is ignored because it is meaningful only for file creation.
# creation.
# #
# `options' must be a hash. # +options+ must be a hash.
# #
# Each option pair with a string key specifies an extra header field for # Each option with a string key specifies an extra header field for HTTP.
# HTTP. I.e., it is ignored for FTP without HTTP proxy. # I.e., it is ignored for FTP without HTTP proxy.
# #
# The hash may include other options, where keys are symbols: # The hash may include other options, where keys are symbols:
# #
@ -552,22 +556,28 @@ module OpenURI
# #
# If :proxy option is specified, the value should be String, URI, # If :proxy option is specified, the value should be String, URI,
# boolean or nil. # boolean or nil.
#
# When String or URI is given, it is treated as proxy URI. # When String or URI is given, it is treated as proxy URI.
#
# When true is given or the option itself is not specified, # When true is given or the option itself is not specified,
# environment variable `scheme_proxy' is examined. # environment variable `scheme_proxy' is examined.
# `scheme' is replaced by `http', `https' or `ftp'. # `scheme' is replaced by `http', `https' or `ftp'.
#
# When false or nil is given, the environment variables are ignored and # When false or nil is given, the environment variables are ignored and
# connection will be made to a server directly. # connection will be made to a server directly.
# #
# [:proxy_http_basic_authentication] # [:proxy_http_basic_authentication]
# Synopsis: # Synopsis:
# :proxy_http_basic_authentication => ["http://proxy.foo.com:8000/", "proxy-user", "proxy-password"] # :proxy_http_basic_authentication =>
# :proxy_http_basic_authentication => [URI.parse("http://proxy.foo.com:8000/"), "proxy-user", "proxy-password"] # ["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. # If :proxy option is specified, the value should be an Array with 3
# It should contain a proxy URI, a proxy user name and a proxy password. # elements. It should contain a proxy URI, a proxy user name and a proxy
# The proxy URI should be a String, an URI or nil. # password. The proxy URI should be a String, an URI or nil. The proxy
# The proxy user name and password should be a String. # user name and password should be a String.
# #
# If nil is given for the proxy URI, this option is just ignored. # If nil is given for the proxy URI, this option is just ignored.
# #
@ -603,7 +613,7 @@ module OpenURI
# #
# If :progress_proc option is specified, the proc is called with one # If :progress_proc option is specified, the proc is called with one
# argument each time when `open' gets content fragment from network. # 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 # If two or more transfer is done by HTTP redirection, the procedure
# is called only one for a last transfer. # is called only one for a last transfer.
@ -644,26 +654,24 @@ module OpenURI
# #
# :ssl_verify_mode is used to specify openssl verify mode. # :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] # [:ftp_active_mode]
# Synopsis: # Synopsis:
# :ftp_active_mode=>bool # :ftp_active_mode=>bool
# #
# :ftp_active_mode=>true is used to make ftp active mode. # <tt>:ftp_active_mode => true</tt> 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. # Ruby 1.9 uses passive mode by default.
# Note that the active mode is default in Ruby 1.8 or prior.
# #
# [:redirect] # [:redirect]
# Synopsis: # Synopsis:
# :redirect=>bool # :redirect=>bool
# #
# :redirect=>false is used to disable all HTTP redirects. # +:redirect+ is true by default. <tt>:redirect => false</tt> is used to
# disable all HTTP redirects.
#
# OpenURI::HTTPRedirect exception raised on redirection. # OpenURI::HTTPRedirect exception raised on redirection.
# It is true by default. # Using +true+ also means that redirections between http and ftp are
# The true means redirections between http and ftp are permitted. # permitted.
# #
def open(*rest, &block) def open(*rest, &block)
OpenURI.open_uri(self, *rest, &block) OpenURI.open_uri(self, *rest, &block)
@ -672,7 +680,7 @@ module OpenURI
# OpenURI::OpenRead#read([options]) reads a content referenced by self and # OpenURI::OpenRead#read([options]) reads a content referenced by self and
# returns the content as string. # returns the content as string.
# The string is extended with OpenURI::Meta. # 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={}) def read(options={})
self.open(options) {|f| self.open(options) {|f|
str = f.read str = f.read