Class: CookbookBumper::RakeTask
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- CookbookBumper::RakeTask
- Defined in:
- lib/cookbook_bumper/rake_task.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(*args) ⇒ RakeTask
constructor
A new instance of RakeTask.
- #run_task ⇒ Object
Constructor Details
#initialize(*args) ⇒ RakeTask
Returns a new instance of RakeTask.
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/cookbook_bumper/rake_task.rb', line 12 def initialize(*args) @name = args.shift || :bump desc 'Bump Cookbooks' unless ::Rake.application.last_description task(name, *args) do yield(@config = CookbookBumper::Config.new) if block_given? run_task end end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
10 11 12 |
# File 'lib/cookbook_bumper/rake_task.rb', line 10 def config @config end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
9 10 11 |
# File 'lib/cookbook_bumper/rake_task.rb', line 9 def name @name end |
Instance Method Details
#run_task ⇒ Object
23 24 25 26 27 |
# File 'lib/cookbook_bumper/rake_task.rb', line 23 def run_task # lazy load gem for snappier task list require 'cookbook_bumper' CookbookBumper.run(config) end |