aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/uri.rb
Commit message (Collapse)AuthorAgeFilesLines
* Remove unused variableRafael Mendonça França2018-03-221-1/+0
|
* Ruby 2.6 will not require monkey patched `URI#unescape`Yasuo Honda2018-03-221-9/+1
| | | | since revision 62897 https://github.com/ruby/ruby/commit/234a30459cdae6aa7da6e28a1082d9c11f315696
* Only apply monkey-patch if detected to be requiredAshe Connor2018-03-091-2/+9
| | | | | | | | | | We test the failing case we're trying to patch; only if it throws an Exception do we patch. Currently this will *always* throw, but upstream Ruby has patched this bug: https://git.io/vAxKB Signed-off-by: Ashe Connor <ashe@kivikakk.ee>
* URI.unescape handles mixed Unicode/escaped inputAshe Connor2018-03-071-1/+1
| | | | | | | | | | | | | | | | | | Previously, URI.enscape could handle Unicode input (without any actual escaped characters), or input with escaped characters (but no actual Unicode characters) - not both. URI.unescape("\xe3\x83\x90") # => "バ" URI.unescape("%E3%83%90") # => "バ" URI.unescape("\xe3\x83\x90%E3%83%90") # => # Encoding::CompatibilityError We need to let `gsub` handle this for us, and then force back to the original encoding of the input. The result String will be mangled if the percent-encoded characters don't conform to the encoding of the String itself, but that goes without saying. Signed-off-by: Ashe Connor <ashe@kivikakk.ee>
* Clarify intentions around method redefinitionsMatthew Draper2017-09-011-1/+2
| | | | | | | | | Don't use remove_method or remove_possible_method just before a new definition: at best the purpose is unclear, and at worst it creates a race condition. Instead, prefer redefine_method when practical, and silence_redefinition_of_method otherwise.
* [Active Support] `rubocop -a --only Layout/EmptyLineAfterMagicComment`Koichi ITO2017-07-111-0/+1
|
* Use frozen-string-literal in ActiveSupportKir Shatrov2017-07-091-0/+1
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* applies new string literal convention in activesupport/libXavier Noria2016-08-061-2/+2
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* File encoding is defaulted to utf-8 in Ruby >= 2.1Akira Matsuda2015-09-181-2/+0
|
* Use block variable instead of globalRoque Pinel2015-06-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | ```ruby Benchmark.ips do |x| x.report("$&") { "foo".gsub(/f/) { $&.hex } } x.report("block var") { "foo".gsub(/f/) { |match| match.hex } } end ``` ``` Calculating ------------------------------------- $& 23.271k i/100ms block var 24.804k i/100ms ------------------------------------------------- $& 321.981k (± 7.4%) i/s - 1.606M block var 324.949k (± 9.2%) i/s - 1.612M ```
* Convert URI.parser.parse to URI.parse, and remove ruby 1.8.x code.kennyj2012-01-191-1/+1
|
* Initial pass at removing dead 1.8.x code from Active Support.José Valim2011-12-201-16/+12
| | | | | | There are a bunch of other implicit branches that adds 1.8.x specific code that still needs to be removed. Pull requests for those cases are welcome.
* Move uri parser to AS as URI.parser method to reuse it in AP and ARes.Emilio Tagua2010-09-281-0/+8
|
* Small optimization of 1.9 unescape. We should make sure that inbound ASCII ↵wycats2010-06-041-2/+6
| | | | always means UTF-8. It seems so based on a quick survey of common browsers, but let's be sure
* Use explicit source encoding rather than forced UTF-8 from US-ASCII.Santiago Pastorino2010-04-261-1/+2
| | | | Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Ruby 1.9.2: URI.escape is obsoleteJeremy Kemper2009-11-021-1/+2
|
* Broaden URI.unescape fix to all affected 1.9.x by checking for broken ↵Jeremy Kemper2009-02-201-6/+12
| | | | behavior instead of specific patchlevel
* URI.unescape fix removes the old unescape methodJeremy Kemper2009-02-201-10/+7
|
* Ruby 1.9.1p0's URI.decode() bug fixmoro2009-02-201-0/+13
backport to fix Ruby 1.9.1p0 bug on [ruby-dev:38005]. Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>