Skip to content

Instantly share code, notes, and snippets.

@vova
Created September 19, 2013 11:51
Show Gist options
  • Save vova/6622297 to your computer and use it in GitHub Desktop.
Save vova/6622297 to your computer and use it in GitHub Desktop.
Remove rails helpers which doesn't have any methods (often created by a generator)
ruby -e 'require "fileutils";Dir.glob("app/helpers/**/*.rb").each{|file| if (!File.read(file).index("def")); FileUtils.rm file; FileUtils.rm_f file.sub("app/", "spec/").sub(".rb", "_spec.rb") if File.exist?("spec"); end}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment