summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorstomar <stomar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-04-17 19:46:25 +0000
committerstomar <stomar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-04-17 19:46:25 +0000
commitc38cb436527c3ba1e1d6635d378feb034a7931f7 (patch)
tree135c166b7f637a95bcfcd78e3f9957f1c5eb6121 /lib
parent8cd5ccdc7fc38d271ebe33c63d64f2950a97aea0 (diff)
lib/uri/file.rb: improve docs for URI::File
* lib/uri/file.rb: [DOC] fix invalid example code for URI::File.build to make it syntax highlighted; drop unnecessary `puts'; fix unintended description list; fix typos. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63182 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/uri/file.rb20
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/uri/file.rb b/lib/uri/file.rb
index 1a98b07d3a..03375dd2cc 100644
--- a/lib/uri/file.rb
+++ b/lib/uri/file.rb
@@ -5,14 +5,14 @@ require 'uri/generic'
module URI
#
- # The "file" URI is defined by RFC8089
+ # The "file" URI is defined by RFC8089.
#
class File < Generic
- # A Default port of nil for URI::File
+ # A Default port of nil for URI::File.
DEFAULT_PORT = nil
#
- # An Array of the available components for URI::File
+ # An Array of the available components for URI::File.
#
COMPONENT = [
:scheme,
@@ -30,20 +30,22 @@ module URI
# The components should be provided either as an Array, or as a Hash
# with keys formed by preceding the component names with a colon.
#
- # If an Array is used, the components must be passed in the order
- # [host, path]
+ # If an Array is used, the components must be passed in the
+ # order <code>[host, path]</code>.
#
# If the path supplied is absolute, it will be escaped in order to
- # make it absolute in the URI. Examples:
+ # make it absolute in the URI.
+ #
+ # Examples:
#
# require 'uri'
#
- # uri = URI::File.build(['host.example.com', '/path/file.zip'])
- # puts uri.to_s -> file://host.example.com/path/file.zip
+ # uri1 = URI::File.build(['host.example.com', '/path/file.zip'])
+ # uri1.to_s # => "file://host.example.com/path/file.zip"
#
# uri2 = URI::File.build({:host => 'host.example.com',
# :path => 'ruby/src'})
- # puts uri2.to_s -> file://host.example.com/ruby/src
+ # uri2.to_s # => "file://host.example.com/ruby/src"
#
def self.build(args)
tmp = Util::make_components_hash(self, args)