Class: ChefDK::ChefResource::GeneratorDesc

Inherits:
Chef::Resource
  • Object
show all
Defined in:
lib/chef-dk/command/generator_commands/chef_exts/generator_desc_resource.rb

Overview

GeneratorDesc is similar to Chef’s built-in log resource, but instead of sending output through the logger, it sends output through the output formatter, which avoids the extra formatting that the logger would add.

As the name implies, it is used to describe the steps that the generator takes to create a cookbook.

Instance Method Summary collapse

Constructor Details

#initialize(name, run_context = nil) ⇒ GeneratorDesc

Returns a new instance of GeneratorDesc.



38
39
40
41
# File 'lib/chef-dk/command/generator_commands/chef_exts/generator_desc_resource.rb', line 38

def initialize(name, run_context = nil)
  super
  @message = name
end

Instance Method Details

#message(arg = nil) ⇒ Object



43
44
45
46
47
48
49
# File 'lib/chef-dk/command/generator_commands/chef_exts/generator_desc_resource.rb', line 43

def message(arg = nil)
  set_or_return(
    :message,
    arg,
    :kind_of => String
  )
end