diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2018-02-15 15:43:29 -0500 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2018-02-15 15:43:29 -0500 |
commit | f282f3758d31e8445d0854e2ae7a67f17cede3bc (patch) | |
tree | 3381c8b6079ae6427ff9def11ed6baeaad7d962b /actionpack | |
parent | 590d89f793bf7a3d8a133cfc3eaa8fee9cbae87c (diff) | |
download | rails-f282f3758d31e8445d0854e2ae7a67f17cede3bc.tar.gz rails-f282f3758d31e8445d0854e2ae7a67f17cede3bc.tar.bz2 rails-f282f3758d31e8445d0854e2ae7a67f17cede3bc.zip |
Revert "Merge pull request #31999 from SamSaffron/patch-1"
This reverts commit 9f65d2a08bc80a94bbb2c0b6e00957c7059aed25, reversing
changes made to 966843732a607864b077b72b2a17168d4e3548cc.
This broken a lot of tests.
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_dispatch/journey/scanner.rb | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/actionpack/lib/action_dispatch/journey/scanner.rb b/actionpack/lib/action_dispatch/journey/scanner.rb index 5ed587c1b1..4ae77903fa 100644 --- a/actionpack/lib/action_dispatch/journey/scanner.rb +++ b/actionpack/lib/action_dispatch/journey/scanner.rb @@ -33,13 +33,6 @@ module ActionDispatch end private - - # takes advantage of String @- deduping capabilities in Ruby 2.5 upwards - # see: https://bugs.ruby-lang.org/issues/13077 - def dedup_scan(regex) - r = @ss.scan(regex) - r ? -r : nil - end def scan case @@ -54,15 +47,15 @@ module ActionDispatch [:OR, "|"] when @ss.skip(/\./) [:DOT, "."] - when text = dedup_scan(/:\w+/) + when text = @ss.scan(/:\w+/) [:SYMBOL, text] - when text = dedup_scan(/\*\w+/) + when text = @ss.scan(/\*\w+/) [:STAR, text] - when text = dedup_scan(/(?:[\w%\-~!$&'*+,;=@]|\\[:()])+/) + when text = @ss.scan(/(?:[\w%\-~!$&'*+,;=@]|\\[:()])+/) text.tr! "\\", "" [:LITERAL, text] # any char - when text = dedup_scan(/./) + when text = @ss.scan(/./) [:LITERAL, text] end end |