Closed stevepolitodesign closed 11 months ago
I think we're running into a flexibility issue.
What if we made a default rake task that looks for whether bundler-audit is installed and run it if so, ignore it otherwise? I have no idea whether that's possible, but it would allow for the kind of extensibility we need.
in lib/suspenders/tasks.rb
task :suspenders do
if Bundler.rubygems.find_name("bundle-audit").any?
Rake::Task[:"bundle:audit"].run
end
if Bundler.rubygems.find_name("standard").any?
Rake::Task[:standard].run
end
end
generated Rakefile
require 'suspenders/tasks'
default: [:suspenders]
Add necessary files to make the plugin an engine, which automatically loads Rake tasks located in
lib/tasks
. This means when thesuspenders
gem is installed, the consumer can runbundle exec rake suspenders:rake
, and any future tasks.Because
suspenders:lint
andsuspenders:advisories
may not necessarily have been invoked, we need to check if those gems are installed.How to review this pull request
Spin up a new Rails application.
Scaffold a domain in order to generate passing tests.
Install suspenders on this branch.
Run the following generators.
Run Rake and note the output. It should run the test suite, run
standard
and runbundler-audit
.Co-authored-by: Mike Burns mburns@thoughtbot.com