diff options
author | Bart de Water <bartdewater@gmail.com> | 2018-07-28 17:37:17 -0400 |
---|---|---|
committer | Bart de Water <bartdewater@gmail.com> | 2018-07-28 17:37:17 -0400 |
commit | eb5fea40a404e829f00552859ae1b206728d99d7 (patch) | |
tree | 3abe3c813b8e64c5bb009902166953a616786232 /actionpack/lib/abstract_controller/helpers.rb | |
parent | 8741052ba25722283ea057f6f022f16b1931ce3e (diff) | |
download | rails-eb5fea40a404e829f00552859ae1b206728d99d7.tar.gz rails-eb5fea40a404e829f00552859ae1b206728d99d7.tar.bz2 rails-eb5fea40a404e829f00552859ae1b206728d99d7.zip |
Enable Start/EndWith and RegexpMatch cops
In cases where the MatchData object is not used, this provides a speed-up:
https://github.com/JuanitoFatas/fast-ruby/#stringmatch-vs-stringmatch-vs-stringstart_withstringend_with-code-start-code-end
Diffstat (limited to 'actionpack/lib/abstract_controller/helpers.rb')
-rw-r--r-- | actionpack/lib/abstract_controller/helpers.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/abstract_controller/helpers.rb b/actionpack/lib/abstract_controller/helpers.rb index 35b462bc92..3191584770 100644 --- a/actionpack/lib/abstract_controller/helpers.rb +++ b/actionpack/lib/abstract_controller/helpers.rb @@ -17,7 +17,7 @@ module AbstractController @path = "helpers/#{path}.rb" set_backtrace error.backtrace - if error.path =~ /^#{path}(\.rb)?$/ + if /^#{path}(\.rb)?$/.match?(error.path) super("Missing helper file helpers/%s.rb" % path) else raise error |