Created
August 25, 2014 06:15
-
-
Save crabbits/47cfe198737a2fc9df4d to your computer and use it in GitHub Desktop.
Pry & Debugger Call Check
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :ci_smoke do | |
desc "Checks project to ensure there are no calls to pry or debugger" | |
task :check_pry_debugger do | |
excluded_dirs = %w{ .git tasks tmp vendor } | |
excluded_files = %w{ Gemfile *.lock } | |
strings = %w{ binding.pry debugger } | |
strings.each do |s| | |
puts("Checking for calls to #{s}") | |
cmd_string = "grep -r" | |
excluded_dirs.each { |ex_dir| cmd_string << " --exclude-dir='#{ex_dir}' " } | |
excluded_files.each { |ex_fil| cmd_string << " --exclude='#{ex_fil}' " } | |
cmd_string << "#{s} ./" | |
fail("call to #{s} found :(") if system(cmd_string) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
nice