Issue #6420 has been updated by cap10morgan (Wes Morgan).


Pull request issued: https://github.com/ruby/ruby/pull/124
----------------------------------------
Bug #6420: undefined local variable or method `parser' for URI::Generic:Class
https://bugs.ruby-lang.org/issues/6420#change-26555

Author: cap10morgan (Wes Morgan)
Status: Open
Priority: Normal
Assignee: 
Category: 
Target version: 
ruby -v: ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.3.0]


=begin
When using the URI::Generic.build2 class method, if a URL component needs to be escaped (space -> %20, for example), it will attempt to call parser.escape on it. This generates an exception of "undefined local variable or method `parser' for URI::Generic:Class" because there is no parser class method. I expected it to return a URI instance with the components properly escaped.

I'm going to submit a pull request on the GitHub mirror that adds this class method and restores the expected behavior.

Code to reproduce:

(({URI::Generic.build2(path: "/foo bar/baz"}))

The space in "foo bar" needs to be escaped in that example, triggering the bug.

=end



-- 
http://bugs.ruby-lang.org/