Rakefile in mrjoy-bundler-audit-0.3.2 vs Rakefile in mrjoy-bundler-audit-0.3.3
- old
+ new
@@ -9,44 +9,38 @@
warn "Run `gem install bundler` to install Bundler."
exit -1
end
begin
- Bundler.setup(:development)
+ Bundler.setup(:default, :development)
rescue Bundler::BundlerError => e
warn e.message
warn "Run `bundle install` to install missing gems."
exit e.status_code
end
require 'rake'
+require 'time'
require 'rubygems/tasks'
Gem::Tasks.new
namespace :db do
desc 'Updates data/ruby-advisory-db'
task :update do
- vendored_ctime = nil
+ timestamp = nil
+
chdir 'data/ruby-advisory-db' do
sh 'git', 'pull', 'origin', 'master'
- vendored_ctime = `git log --pretty="%cd" -1`.chomp
+
+ File.open('../ruby-advisory-db.ts','w') do |file|
+ file.write Time.parse(`git log --pretty="%cd" -1`).utc
+ end
end
- File.open("lib/bundler/audit/vendored_time.rb", "w") do |fh|
- fh.write(%Q{
-# WARNING: DO NOT EDIT THIS FILE BY HAND. IT IS AUTO-GENERATED!
-module Bundler
- module Audit
- class Database
- VENDORED_REPO_CTIME = Time.parse("#{vendored_ctime}")
- end
- end
-end
-})
- end
sh 'git', 'commit', 'data/ruby-advisory-db',
+ 'data/ruby-advisory-db.ts',
'-m', 'Updated ruby-advisory-db'
end
end
require 'rspec/core/rake_task'
@@ -56,17 +50,11 @@
task :bundle do
root = 'spec/bundle'
%w[secure unpatched_gems insecure_sources].each do |bundle|
chdir(File.join(root,bundle)) do
- begin
- sh 'BUNDLE_BIN_PATH="" BUNDLE_GEMFILE="" RUBYOPT="" bundle install --path ../../../vendor/bundle'
- rescue
- exit(1) if(!File.exist?('Gemfile.lock'))
- puts "Looks like Gemfile may have been updated. Attempting to update things."
- sh 'BUNDLE_BIN_PATH="" BUNDLE_GEMFILE="" RUBYOPT="" bundle update'
- end
+ sh 'BUNDLE_BIN_PATH="" BUNDLE_GEMFILE="" RUBYOPT="" bundle install --path ../../../vendor/bundle'
end
end
end
end
task :spec => 'spec:bundle'
@@ -75,5 +63,10 @@
task :default => :spec
require 'yard'
YARD::Rake::YardocTask.new
task :doc => :yard
+
+require './lib/bundler/audit/task'
+Bundler::Audit::Task.new do |r|
+ r.verbose = true
+end