Browse files

Merge branch 'master' of git://

* 'master' of git://
  Adding a test for 7a69f41
  grep with --exclude was resulting in hits on files with names like 'app/models/.svn/text-base/reading_list.rb.svn-base'.  Piping through an additional grep process seems a little wasteful, but it does the job for folks who have an app on Subversion.
  • Loading branch information...
2 parents e058beb + 87e370c commit 11d080483155840419f56d9940a73aaaa2e275c7 @radar radar committed Apr 7, 2011
Showing with 8 additions and 2 deletions.
  1. +2 −2 lib/application_checker.rb
  2. +6 −0 test/application_checker_test.rb
@@ -378,9 +378,9 @@ def find_with_grep(text, where, double_quote, perl_regex = false)
value = ""
# Specifically double quote for finding 'test_help'
command = if double_quote
- "grep -r #{"-P" if perl_regex} --exclude=\*.svn\* \"#{text}\" #{where}"
+ "grep -r #{"-P" if perl_regex} \"#{text}\" #{where} | grep -v \.svn"
- "grep -r #{"-P" if perl_regex} --exclude=\*.svn\* '#{text}' #{where}"
+ "grep -r #{"-P" if perl_regex} '#{text}' #{where} | grep -v \.svn"
Open3.popen3(command) do |stdin, stdout, stderr|
@@ -58,6 +58,12 @@ def test_check_ar_methods_in_models
assert @checker.alerts.has_key?("Soon-to-be-deprecated ActiveRecord calls")
+ def test_check_svn_subdirs_are_not_included
+ make_file("app/models/.svn/text-base", "foo.rb.tmp", "Post.find(:all)")
+ @checker.check_ar_methods
+ assert @checker.alerts.empty?
+ end
def test_check_validation_on_methods
make_file("app/models", "post.rb", "validate_on_create :comments_valid?")

0 comments on commit 11d0804

Please sign in to comment.