Remove 100% escape and selectively escape text for grep

This commit is contained in:
Jeremy McAnally 2010-02-02 21:13:32 -06:00
parent 93b8e4e9b4
commit 411b5283e0

View File

@ -52,7 +52,7 @@ module Rails
# Check for deprecated router syntax # Check for deprecated router syntax
def check_routes def check_routes
lines = ["map.", "ActionController::Routing::Routes", ".resources"].map do |v| lines = ["map\\.", "ActionController::Routing::Routes", "\\.resources"].map do |v|
grep_for(v, "config/routes.rb").empty? ? nil : true grep_for(v, "config/routes.rb").empty? ? nil : true
end.compact end.compact
@ -201,7 +201,7 @@ module Rails
def find_with_grep(text, where) def find_with_grep(text, where)
value = "" value = ""
Open3.popen3("grep -r '#{Regexp.escape(text)}' #{where}") do |stdin, stdout, stderr| Open3.popen3("grep -r '#{text}' #{where}") do |stdin, stdout, stderr|
value = stdout.read value = stdout.read
end end