Class: Bundler::Audit::Task
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- Bundler::Audit::Task
- Defined in:
- lib/bundler/audit/task.rb
Overview
Defines the bundle:audit
rake tasks.
Defined Under Namespace
Classes: CommandNotFound
Instance Method Summary collapse
-
#bundler_audit(*arguments) ⇒ true
private
Runs the
bundler-audit
command with the additional arguments. -
#check ⇒ true
private
Runs the
bundle-audit check
command. -
#define ⇒ Object
protected
Defines the
bundle:audit
andbundle:audit:update
task. -
#initialize ⇒ Task
constructor
Initializes the task.
-
#update ⇒ true
private
Runs the
bundle-audit update
command.
Constructor Details
#initialize ⇒ Task
Initializes the task.
15 16 17 |
# File 'lib/bundler/audit/task.rb', line 15 def initialize define end |
Instance Method Details
#bundler_audit(*arguments) ⇒ true
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
If the bundler-audit
command exits with an error, the rake task
will also exit with the same error code.
Runs the bundler-audit
command with the additional arguments.
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/bundler/audit/task.rb', line 37 def bundler_audit(*arguments) case system('bundler-audit',*arguments) when false exit $?.exitstatus || 1 when nil raise(CommandNotFound,"bundler-audit could not be executed") else return true end end |
#check ⇒ true
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
If the bundler-audit
command exits with an error, the rake task
will also exit with the same error code.
Runs the bundle-audit check
command.
63 64 65 |
# File 'lib/bundler/audit/task.rb', line 63 def check bundler_audit 'check' end |
#define ⇒ Object (protected)
Defines the bundle:audit
and bundle:audit:update
task.
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/bundler/audit/task.rb', line 91 def define namespace :bundle do namespace :audit do desc 'Checks the Gemfile.lock for insecure dependencies' task :check do check end desc 'Updates the bundler-audit vulnerability database' task :update do update end end task :audit => 'audit:check' end task 'bundler:audit' => 'bundle:audit' task 'bundler:audit:check' => 'bundle:audit:check' task 'bundler:audit:update' => 'bundle:audit:update' end |
#update ⇒ true
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
If the bundler-audit
command exits with an error, the rake task
will also exit with the same error code.
Runs the bundle-audit update
command.
82 83 84 |
# File 'lib/bundler/audit/task.rb', line 82 def update bundler_audit 'update' end |