From 411b5283e0e5d728d324f054380c56b1508dc8fe Mon Sep 17 00:00:00 2001 From: Jeremy McAnally Date: Tue, 2 Feb 2010 21:13:32 -0600 Subject: [PATCH] Remove 100% escape and selectively escape text for grep --- lib/application_checker.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/application_checker.rb b/lib/application_checker.rb index 695e29d..b8290de 100644 --- a/lib/application_checker.rb +++ b/lib/application_checker.rb @@ -52,7 +52,7 @@ module Rails # Check for deprecated router syntax 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 end.compact @@ -201,7 +201,7 @@ module Rails def find_with_grep(text, where) 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 end