aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/testing/resolvers.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2016-07-25 00:31:35 +0200
committerXavier Noria <fxn@hashref.com>2016-07-25 00:31:35 +0200
commit7ebef567ce30d848dd8f9374fd70699fd91acb29 (patch)
tree9452737beec405626f309348b6d3c7fe4838ed91 /actionview/lib/action_view/testing/resolvers.rb
parent11b463d8cbacfe2cc1662f9e314440de71806ca9 (diff)
downloadrails-7ebef567ce30d848dd8f9374fd70699fd91acb29.tar.gz
rails-7ebef567ce30d848dd8f9374fd70699fd91acb29.tar.bz2
rails-7ebef567ce30d848dd8f9374fd70699fd91acb29.zip
systematic revision of =~ usage in AV
Where appropriate, prefer the more concise Regexp#match?, String#include?, String#start_with?, or String#end_with?
Diffstat (limited to 'actionview/lib/action_view/testing/resolvers.rb')
-rw-r--r--actionview/lib/action_view/testing/resolvers.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/actionview/lib/action_view/testing/resolvers.rb b/actionview/lib/action_view/testing/resolvers.rb
index 2664aca991..982ecf9efc 100644
--- a/actionview/lib/action_view/testing/resolvers.rb
+++ b/actionview/lib/action_view/testing/resolvers.rb
@@ -1,3 +1,4 @@
+require 'active_support/core_ext/regexp'
require 'action_view/template/resolver'
module ActionView #:nodoc:
@@ -29,7 +30,7 @@ module ActionView #:nodoc:
templates = []
@hash.each do |_path, array|
source, updated_at = array
- next unless _path =~ query
+ next unless query.match?(_path)
handler, format, variant = extract_handler_and_format_and_variant(_path, formats)
templates << Template.new(source, _path, handler,
:virtual_path => path.virtual,
@@ -50,4 +51,3 @@ module ActionView #:nodoc:
end
end
end
-