class Emeril::ThorTasks

Emeril Rake task generator.

@author Fletcher Nichol <fnichol@nichol.ca>

Attributes

config[RW]

Public Class Methods

new(*args) { |self| ... } click to toggle source

Creates Emeril Thor tasks and allows the callee to configure it.

@yield [self] gives itself to the block

Calls superclass method
# File lib/emeril/thor_tasks.rb, line 23
def initialize(*args)
  super
  @config = { :logger => Chef::Log }
  yield self if block_given?
  define
end

Private Instance Methods

define() click to toggle source
# File lib/emeril/thor_tasks.rb, line 32
def define
  metadata = Emeril::MetadataChopper.new("metadata.rb")
  artifact = "#{metadata[:name]}-#{metadata[:version]}"

  self.class.desc "release",
    "Create git tag for #{artifact} and push to the Community Site"
  self.class.send(:define_method, :release) do
    Chef::Knife.new.configure_chef
    Emeril::Releaser.new(@config).run
  end
end