From eb5fea40a404e829f00552859ae1b206728d99d7 Mon Sep 17 00:00:00 2001 From: Bart de Water Date: Sat, 28 Jul 2018 17:37:17 -0400 Subject: 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 --- railties/lib/rails/app_loader.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/lib/rails/app_loader.rb') diff --git a/railties/lib/rails/app_loader.rb b/railties/lib/rails/app_loader.rb index 20eb75d95c..aabcc5970c 100644 --- a/railties/lib/rails/app_loader.rb +++ b/railties/lib/rails/app_loader.rb @@ -49,7 +49,7 @@ EOS if exe = find_executable contents = File.read(exe) - if contents =~ /(APP|ENGINE)_PATH/ + if /(APP|ENGINE)_PATH/.match?(contents) exec RUBY, exe, *ARGV break # non reachable, hack to be able to stub exec in the test suite elsif exe.end_with?("bin/rails") && contents.include?("This file was generated by Bundler") -- cgit v1.2.3