aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2012-01-19 09:30:08 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2012-01-19 09:30:08 -0800
commit01cde0b246d47b2aedcd2568990fb61d384ca173 (patch)
treea62ca9b45af1419869a3907d259fc324d69388b3 /activesupport
parent2c7ded31fb89c924bcb3a1b5f57d5c0f5b675ef1 (diff)
parentd8b06dc5c250f80687f3e9d5de77b6cdf106c8f0 (diff)
downloadrails-01cde0b246d47b2aedcd2568990fb61d384ca173.tar.gz
rails-01cde0b246d47b2aedcd2568990fb61d384ca173.tar.bz2
rails-01cde0b246d47b2aedcd2568990fb61d384ca173.zip
Merge pull request #4538 from kennyj/should_use_uri_parse
Convert URI.parser.parse to URI.parse, and remove ruby 1.8.x code.
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/core_ext/uri.rb2
-rw-r--r--activesupport/test/core_ext/uri_ext_test.rb8
2 files changed, 3 insertions, 7 deletions
diff --git a/activesupport/lib/active_support/core_ext/uri.rb b/activesupport/lib/active_support/core_ext/uri.rb
index 0b219ce44a..bfe0832b37 100644
--- a/activesupport/lib/active_support/core_ext/uri.rb
+++ b/activesupport/lib/active_support/core_ext/uri.rb
@@ -20,7 +20,7 @@ end
module URI
class << self
def parser
- @parser ||= URI.const_defined?(:Parser) ? URI::Parser.new : URI
+ @parser ||= URI::Parser.new
end
end
end
diff --git a/activesupport/test/core_ext/uri_ext_test.rb b/activesupport/test/core_ext/uri_ext_test.rb
index 4a6cbb8801..03e388dd7a 100644
--- a/activesupport/test/core_ext/uri_ext_test.rb
+++ b/activesupport/test/core_ext/uri_ext_test.rb
@@ -7,11 +7,7 @@ class URIExtTest < ActiveSupport::TestCase
def test_uri_decode_handle_multibyte
str = "\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E" # Ni-ho-nn-go in UTF-8, means Japanese.
- if URI.const_defined?(:Parser)
- parser = URI::Parser.new
- assert_equal str, parser.unescape(parser.escape(str))
- else
- assert_equal str, URI.unescape(URI.escape(str))
- end
+ parser = URI::Parser.new
+ assert_equal str, parser.unescape(parser.escape(str))
end
end