Permalink
Browse files

Use bundle-audit rake task from the gem

Instead of defining the audit task from scratch, we can import
the task from the gem itself.
  • Loading branch information...
1 parent 3725842 commit ae2281eec4bf624115049604e6e4998bf9517234 @odlp odlp committed with odlp Mar 10, 2017
Showing with 11 additions and 11 deletions.
  1. +1 −1 lib/suspenders/app_builder.rb
  2. +8 −0 spec/features/new_project_spec.rb
  3. +2 −10 templates/bundler_audit.rake
@@ -401,7 +401,7 @@ def setup_segment
def setup_bundler_audit
copy_file "bundler_audit.rake", "lib/tasks/bundler_audit.rake"
- append_file "Rakefile", %{\ntask default: "bundler:audit"\n}
+ append_file "Rakefile", %{\ntask default: "bundle:audit"\n}
end
def setup_spring
@@ -29,6 +29,14 @@
end
end
+ it "includes the bundle:audit task" do
+ Dir.chdir(project_path) do
+ Bundler.with_clean_env do
+ expect(`rake -T`).to include('rake bundle:audit')
+ end
+ end
+ end
+
it "creates .ruby-version from Suspenders .ruby-version" do
ruby_version_file = IO.read("#{project_path}/.ruby-version")
@@ -1,12 +1,4 @@
if Rails.env.development? || Rails.env.test?
- require "bundler/audit/cli"
-
- namespace :bundler do
- desc "Updates the ruby-advisory-db and runs audit"
- task :audit do
- %w(update check).each do |command|
- Bundler::Audit::CLI.start [command]
- end
- end
- end
+ require "bundler/audit/task"
+ Bundler::Audit::Task.new
end

0 comments on commit ae2281e

Please sign in to comment.