Class: CookbookBumper::RakeTask

Inherits:
Rake::TaskLib
  • Object
show all
Defined in:
lib/cookbook_bumper/rake_task.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#configObject

Returns the value of attribute config.



10
11
12
# File 'lib/cookbook_bumper/rake_task.rb', line 10

def config
  @config
end

#nameObject (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_taskObject



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