Remove Empty Helpers
find app/helpers -type f | xargs wc -l | grep '^ *2 ' | awk '{print $2}' | xargs rm
Written by Frank
Related protips
2 Responses
Tests and fixtures might have been generated along with the empty helpers.
This will be a real handy if you can modify it to remove such common files( e.g. productshelper.rb, spec/helpers/productshelper_spec.rb) too.
over 1 year ago
·
I can't think of a consistant method to check if a helper spec is "empty", especially not by counting lines.
You could configure RSpec, in application.rb, to not create these files:
config.generators do |g|
g.test_framework :rspec,
fixtures: false,
view_specs: false,
helper_specs: false,
routing_specs: false,
controller_specs: true,
request_specs: true
end
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#