summaryrefslogtreecommitdiff
path: root/lib/open-uri.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-08-04 22:00:31 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-08-04 22:00:31 +0000
commit91edcb053b3dd0a86ad7cec0a652d084d6e7dd46 (patch)
tree3ebfb81d7fdc03904604b2c7148180d7c6b02cec /lib/open-uri.rb
parent4d2d744487d6f2ca97d034c7b7d5c2a4836fc5db (diff)
Merge RDoc changes from HEAD.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/open-uri.rb')
-rw-r--r--lib/open-uri.rb109
1 files changed, 53 insertions, 56 deletions
diff --git a/lib/open-uri.rb b/lib/open-uri.rb
index ce6058935d..d69f7dbe41 100644
--- a/lib/open-uri.rb
+++ b/lib/open-uri.rb
@@ -1,59 +1,3 @@
-#= open-uri.rb
-#
-#open-uri.rb is easy-to-use wrapper for net/http, net/https and net/ftp.
-#
-#== Example
-#
-#It is possible to open http/https/ftp URL as usual a file:
-#
-# open("http://www.ruby-lang.org/") {|f|
-# f.each_line {|line| p line}
-# }
-#
-#The opened file has several methods for meta information as follows since
-#it is extended by OpenURI::Meta.
-#
-# open("http://www.ruby-lang.org/en") {|f|
-# f.each_line {|line| p line}
-# p f.base_uri # <URI::HTTP:0x40e6ef2 URL:http://www.ruby-lang.org/en/>
-# p f.content_type # "text/html"
-# p f.charset # "iso-8859-1"
-# p f.content_encoding # []
-# p f.last_modified # Thu Dec 05 02:45:02 UTC 2002
-# }
-#
-#Additional header fields can be specified by an optional hash argument.
-#
-# open("http://www.ruby-lang.org/en/",
-# "User-Agent" => "Ruby/#{RUBY_VERSION}",
-# "From" => "foo@bar.invalid",
-# "Referer" => "http://www.ruby-lang.org/") {|f|
-# ...
-# }
-#
-#The environment variables such as http_proxy, https_proxy and ftp_proxy
-#are in effect by default. :proxy => nil disables proxy.
-#
-# open("http://www.ruby-lang.org/en/raa.html",
-# :proxy => nil) {|f|
-# ...
-# }
-#
-#URI objects can be opened in similar way.
-#
-# uri = URI.parse("http://www.ruby-lang.org/en/")
-# uri.open {|f|
-# ...
-# }
-#
-#URI objects can be read directly.
-#The returned string is also extended by OpenURI::Meta.
-#
-# str = uri.read
-# p str.base_uri
-#
-#Author:: Tanaka Akira <akr@m17n.org>
-
require 'uri'
require 'stringio'
require 'time'
@@ -91,6 +35,59 @@ module Kernel
module_function :open
end
+# OpenURI is an easy-to-use wrapper for net/http, net/https and net/ftp.
+#
+#== Example
+#
+# It is possible to open http/https/ftp URL as usual like opening a file:
+#
+# open("http://www.ruby-lang.org/") {|f|
+# f.each_line {|line| p line}
+# }
+#
+# The opened file has several methods for meta information as follows since
+# it is extended by OpenURI::Meta.
+#
+# open("http://www.ruby-lang.org/en") {|f|
+# f.each_line {|line| p line}
+# p f.base_uri # <URI::HTTP:0x40e6ef2 URL:http://www.ruby-lang.org/en/>
+# p f.content_type # "text/html"
+# p f.charset # "iso-8859-1"
+# p f.content_encoding # []
+# p f.last_modified # Thu Dec 05 02:45:02 UTC 2002
+# }
+#
+# Additional header fields can be specified by an optional hash argument.
+#
+# open("http://www.ruby-lang.org/en/",
+# "User-Agent" => "Ruby/#{RUBY_VERSION}",
+# "From" => "foo@bar.invalid",
+# "Referer" => "http://www.ruby-lang.org/") {|f|
+# # ...
+# }
+#
+# The environment variables such as http_proxy, https_proxy and ftp_proxy
+# are in effect by default. :proxy => nil disables proxy.
+#
+# open("http://www.ruby-lang.org/en/raa.html", :proxy => nil) {|f|
+# # ...
+# }
+#
+# URI objects can be opened in a similar way.
+#
+# uri = URI.parse("http://www.ruby-lang.org/en/")
+# uri.open {|f|
+# # ...
+# }
+#
+# URI objects can be read directly. The returned string is also extended by
+# OpenURI::Meta.
+#
+# str = uri.read
+# p str.base_uri
+#
+# Author:: Tanaka Akira <akr@m17n.org>
+
module OpenURI
Options = {
:proxy => true,