Class: ChefApply::Action::GenerateTempCookbook
- Defined in:
- lib/chef_apply/action/generate_temp_cookbook.rb
Direct Known Subclasses
Constant Summary
Constants inherited from Base
Instance Attribute Summary collapse
-
#generated_cookbook ⇒ Object
readonly
Returns the value of attribute generated_cookbook.
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(options) ⇒ GenerateTempCookbook
constructor
A new instance of GenerateTempCookbook.
- #perform_action ⇒ Object
Methods inherited from Base
#escape_windows_path, #name, #notify, #run, #run_chef
Constructor Details
#initialize(options) ⇒ GenerateTempCookbook
Returns a new instance of GenerateTempCookbook.
38 39 40 41 |
# File 'lib/chef_apply/action/generate_temp_cookbook.rb', line 38 def initialize() super() @generated_cookbook ||= ChefApply::TempCookbook.new end |
Instance Attribute Details
#generated_cookbook ⇒ Object (readonly)
Returns the value of attribute generated_cookbook.
24 25 26 |
# File 'lib/chef_apply/action/generate_temp_cookbook.rb', line 24 def generated_cookbook @generated_cookbook end |
Class Method Details
.from_options(opts) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/chef_apply/action/generate_temp_cookbook.rb', line 26 def self.(opts) if opts.key?(:recipe_spec) GenerateCookbookFromRecipe.new(opts) elsif opts.key?(:resource_name) && opts.key?(:resource_type) && opts.key?(:resource_properties) GenerateCookbookFromResource.new(opts) else raise MissingOptions.new(opts) end end |
Instance Method Details
#generate ⇒ Object
49 50 51 |
# File 'lib/chef_apply/action/generate_temp_cookbook.rb', line 49 def generate raise NotImplemented end |
#perform_action ⇒ Object
43 44 45 46 47 |
# File 'lib/chef_apply/action/generate_temp_cookbook.rb', line 43 def perform_action notify(:generating) generate notify(:success) end |