Skip to content

Commit 61c6a47

Browse files
committed
Remove deprecated URI.escape/URI.unescape
1 parent 333d874 commit 61c6a47

File tree

1 file changed

+0
-76
lines changed

1 file changed

+0
-76
lines changed

lib/uri/common.rb

Lines changed: 0 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -60,82 +60,6 @@ def make_components_hash(klass, array_hash)
6060
module_function :make_components_hash
6161
end
6262

63-
# Module for escaping unsafe characters with codes.
64-
module Escape
65-
#
66-
# == Synopsis
67-
#
68-
# URI.escape(str [, unsafe])
69-
#
70-
# == Args
71-
#
72-
# +str+::
73-
# String to replaces in.
74-
# +unsafe+::
75-
# Regexp that matches all symbols that must be replaced with codes.
76-
# By default uses <tt>UNSAFE</tt>.
77-
# When this argument is a String, it represents a character set.
78-
#
79-
# == Description
80-
#
81-
# Escapes the string, replacing all unsafe characters with codes.
82-
#
83-
# This method is obsolete and should not be used. Instead, use
84-
# CGI.escape, URI.encode_www_form or URI.encode_www_form_component
85-
# depending on your specific use case.
86-
#
87-
# == Usage
88-
#
89-
# require 'uri'
90-
#
91-
# enc_uri = URI.escape("http://example.com/?a=\11\15")
92-
# # => "http://example.com/?a=%09%0D"
93-
#
94-
# URI.unescape(enc_uri)
95-
# # => "http://example.com/?a=\t\r"
96-
#
97-
# URI.escape("@?@!", "!?")
98-
# # => "@%3F@%21"
99-
#
100-
def escape(*arg)
101-
warn "URI.#{__callee__} is obsolete", uplevel: 1
102-
DEFAULT_PARSER.escape(*arg)
103-
end
104-
alias encode escape
105-
#
106-
# == Synopsis
107-
#
108-
# URI.unescape(str)
109-
#
110-
# == Args
111-
#
112-
# +str+::
113-
# String to unescape.
114-
#
115-
# == Description
116-
#
117-
# This method is obsolete and should not be used. Instead, use
118-
# CGI.unescape, URI.decode_www_form or URI.decode_www_form_component
119-
# depending on your specific use case.
120-
#
121-
# == Usage
122-
#
123-
# require 'uri'
124-
#
125-
# enc_uri = URI.escape("http://example.com/?a=\11\15")
126-
# # => "http://example.com/?a=%09%0D"
127-
#
128-
# URI.unescape(enc_uri)
129-
# # => "http://example.com/?a=\t\r"
130-
#
131-
def unescape(*arg)
132-
warn "URI.#{__callee__} is obsolete", uplevel: 1
133-
DEFAULT_PARSER.unescape(*arg)
134-
end
135-
alias decode unescape
136-
end # module Escape
137-
138-
extend Escape
13963
include REGEXP
14064

14165
@@schemes = {}

0 commit comments

Comments
 (0)