Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d2a79c6

Browse files
committed
[DOC] Update old use of URI::Parser
1 parent 372fbb4 commit d2a79c6

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

lib/uri/generic.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ def registry # :nodoc:
284284

285285
# Returns the parser to be used.
286286
#
287-
# Unless a URI::Parser is defined, DEFAULT_PARSER is used.
287+
# Unless the +parser+ is defined, DEFAULT_PARSER is used.
288288
#
289289
def parser
290290
if !defined?(@parser) || !@parser
@@ -315,7 +315,7 @@ def component
315315
end
316316

317317
#
318-
# Checks the scheme +v+ component against the URI::Parser Regexp for :SCHEME.
318+
# Checks the scheme +v+ component against the +parser+ Regexp for :SCHEME.
319319
#
320320
def check_scheme(v)
321321
if v && parser.regexp[:SCHEME] !~ v
@@ -385,7 +385,7 @@ def check_userinfo(user, password = nil)
385385

386386
#
387387
# Checks the user +v+ component for RFC2396 compliance
388-
# and against the URI::Parser Regexp for :USERINFO.
388+
# and against the +parser+ Regexp for :USERINFO.
389389
#
390390
# Can not have a registry or opaque component defined,
391391
# with a user component defined.
@@ -409,7 +409,7 @@ def check_user(v)
409409

410410
#
411411
# Checks the password +v+ component for RFC2396 compliance
412-
# and against the URI::Parser Regexp for :USERINFO.
412+
# and against the +parser+ Regexp for :USERINFO.
413413
#
414414
# Can not have a registry or opaque component defined,
415415
# with a user component defined.
@@ -586,7 +586,7 @@ def decoded_password
586586

587587
#
588588
# Checks the host +v+ component for RFC2396 compliance
589-
# and against the URI::Parser Regexp for :HOST.
589+
# and against the +parser+ Regexp for :HOST.
590590
#
591591
# Can not have a registry or opaque component defined,
592592
# with a host component defined.
@@ -675,7 +675,7 @@ def hostname=(v)
675675

676676
#
677677
# Checks the port +v+ component for RFC2396 compliance
678-
# and against the URI::Parser Regexp for :PORT.
678+
# and against the +parser+ Regexp for :PORT.
679679
#
680680
# Can not have a registry or opaque component defined,
681681
# with a port component defined.
@@ -748,7 +748,7 @@ def registry=(v) # :nodoc:
748748

749749
#
750750
# Checks the path +v+ component for RFC2396 compliance
751-
# and against the URI::Parser Regexp
751+
# and against the +parser+ Regexp
752752
# for :ABS_PATH and :REL_PATH.
753753
#
754754
# Can not have a opaque component defined,
@@ -853,7 +853,7 @@ def query=(v)
853853

854854
#
855855
# Checks the opaque +v+ component for RFC2396 compliance and
856-
# against the URI::Parser Regexp for :OPAQUE.
856+
# against the +parser+ Regexp for :OPAQUE.
857857
#
858858
# Can not have a host, port, user, or path component defined,
859859
# with an opaque component defined.
@@ -905,7 +905,7 @@ def opaque=(v)
905905
end
906906

907907
#
908-
# Checks the fragment +v+ component against the URI::Parser Regexp for :FRAGMENT.
908+
# Checks the fragment +v+ component against the +parser+ Regexp for :FRAGMENT.
909909
#
910910
#
911911
# == Args

lib/uri/rfc2396_parser.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class RFC2396_Parser
6767
#
6868
# == Synopsis
6969
#
70-
# URI::Parser.new([opts])
70+
# URI::RFC2396_Parser.new([opts])
7171
#
7272
# == Args
7373
#
@@ -86,7 +86,7 @@ class RFC2396_Parser
8686
#
8787
# == Examples
8888
#
89-
# p = URI::Parser.new(:ESCAPED => "(?:%[a-fA-F0-9]{2}|%u[a-fA-F0-9]{4})")
89+
# p = URI::RFC2396_Parser.new(:ESCAPED => "(?:%[a-fA-F0-9]{2}|%u[a-fA-F0-9]{4})")
9090
# u = p.parse("http://example.jp/%uABCD") #=> #<URI::HTTP http://example.jp/%uABCD>
9191
# URI.parse(u.to_s) #=> raises URI::InvalidURIError
9292
#
@@ -202,8 +202,7 @@ def split(uri)
202202
#
203203
# == Usage
204204
#
205-
# p = URI::Parser.new
206-
# p.parse("ldap://ldap.example.com/dc=example?user=john")
205+
# URI::RFC2396_PARSER.parse("ldap://ldap.example.com/dc=example?user=john")
207206
# #=> #<URI::LDAP ldap://ldap.example.com/dc=example?user=john>
208207
#
209208
def parse(uri)

0 commit comments

Comments
 (0)