Skip to content

Instantly share code, notes, and snippets.

@crabbits
Created August 25, 2014 06:15
Show Gist options
  • Save crabbits/47cfe198737a2fc9df4d to your computer and use it in GitHub Desktop.
Save crabbits/47cfe198737a2fc9df4d to your computer and use it in GitHub Desktop.
Pry & Debugger Call Check
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
@catkins
Copy link

catkins commented Aug 25, 2014

nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment