summaryrefslogtreecommitdiff
path: root/lib/uri/generic.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/uri/generic.rb')
-rw-r--r--lib/uri/generic.rb19
1 files changed, 5 insertions, 14 deletions
diff --git a/lib/uri/generic.rb b/lib/uri/generic.rb
index 69698c4e2d..bdd366661e 100644
--- a/lib/uri/generic.rb
+++ b/lib/uri/generic.rb
@@ -945,7 +945,7 @@ module URI
# == Description
#
# URI has components listed in order of decreasing significance from left to right,
- # see RFC3986 https://tools.ietf.org/html/rfc3986 1.2.3.
+ # see RFC3986 https://www.rfc-editor.org/rfc/rfc3986 1.2.3.
#
# == Usage
#
@@ -1364,6 +1364,9 @@ module URI
str << ':'
str << @port.to_s
end
+ if (@host || @port) && !@path.empty? && !@path.start_with?('/')
+ str << '/'
+ end
str << @path
if @query
str << '?'
@@ -1376,6 +1379,7 @@ module URI
end
str
end
+ alias to_str to_s
#
# Compares two URIs.
@@ -1398,19 +1402,6 @@ module URI
self.component_ary.eql?(oth.component_ary)
end
-=begin
-
---- URI::Generic#===(oth)
-
-=end
-# def ===(oth)
-# raise NotImplementedError
-# end
-
-=begin
-=end
-
-
# Returns an Array of the components defined from the COMPONENT Array.
def component_ary
component.collect do |x|