diff --git a/lib/uri/file.rb b/lib/uri/file.rb index 7671ad6470..4ff0bc097e 100644 --- a/lib/uri/file.rb +++ b/lib/uri/file.rb @@ -33,6 +33,9 @@ module URI # If an Array is used, the components must be passed in the # order <code>[host, path]</code>. # + # A path from e.g. the File class should be escaped before + # being passed. + # # Examples: # # require 'uri' @@ -44,6 +47,9 @@ module URI # :path => '/ruby/src'}) # uri2.to_s # => "file://host.example.com/ruby/src" # + # uri3 = URI::File.build({:path => URI::escape('/path/my file.txt')}) + # uri3.to_s # => "file:///path/my%20file.txt" + # def self.build(args) tmp = Util::make_components_hash(self, args) super(tmp)