Skip to content

Instantly share code, notes, and snippets.

@thorn
Last active January 30, 2016 18:10
Show Gist options
  • Save thorn/6e841124f0556d61d2ef to your computer and use it in GitHub Desktop.
Save thorn/6e841124f0556d61d2ef to your computer and use it in GitHub Desktop.
Run bundler:audit on every rake task. Source: https://eliotsykes.com/bundler-audit
# File: ./lib/tasks/bundler_audit.rake
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
end
# File: ./Rakefile
require File.expand_path('../config/application', __FILE__)
Rails.application.load_tasks
task default: 'bundler:audit'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment