Class: Bundler::Audit::Task
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- Bundler::Audit::Task
- Defined in:
- lib/bundler/audit/task.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
-
#ignore ⇒ Object
Returns the value of attribute ignore.
-
#name ⇒ Object
Returns the value of attribute name.
-
#options ⇒ Object
Returns the value of attribute options.
-
#verbose ⇒ Object
Returns the value of attribute verbose.
Instance Method Summary collapse
- #define ⇒ Object protected
-
#initialize(*args, &block) ⇒ Task
constructor
A new instance of Task.
- #run ⇒ Object protected
Constructor Details
#initialize(*args, &block) ⇒ Task
Returns a new instance of Task.
15 16 17 18 19 20 21 |
# File 'lib/bundler/audit/task.rb', line 15 def initialize(*args, &block) @options = args || [] @block = block if block @verbose = false define end |
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block.
11 12 13 |
# File 'lib/bundler/audit/task.rb', line 11 def block @block end |
#ignore ⇒ Object
Returns the value of attribute ignore.
13 14 15 |
# File 'lib/bundler/audit/task.rb', line 13 def ignore @ignore end |
#name ⇒ Object
Returns the value of attribute name.
9 10 11 |
# File 'lib/bundler/audit/task.rb', line 9 def name @name end |
#options ⇒ Object
Returns the value of attribute options.
10 11 12 |
# File 'lib/bundler/audit/task.rb', line 10 def @options end |
#verbose ⇒ Object
Returns the value of attribute verbose.
12 13 14 |
# File 'lib/bundler/audit/task.rb', line 12 def verbose @verbose end |
Instance Method Details
#define ⇒ Object (protected)
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/bundler/audit/task.rb', line 24 def define desc "Run Bundler-audit" unless ::Rake.application.last_comment @name = .shift || :audit task @name, * do |_, task_args| RakeFileUtils.send(:verbose, @verbose) do block.call(self) if block run end end end |