Class: PuppetGenerator::Task

Inherits:
Object
  • Object
show all
Includes:
PuppetHelper
Defined in:
lib/puppet_generator/task.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from PuppetHelper

#puppet_class_name, #puppet_manifest_path, #puppet_module_name, #puppet_module_path

Constructor Details

#initialize(options = {}) ⇒ Task

Returns a new instance of Task.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/puppet_generator/task.rb', line 9

def initialize(options={})
  @meta = {}
  @body = nil

  @meta[:source]        = options[:source] 
  @meta[:destination]   = options[:destination]
  @meta[:module]        = puppet_module_name( options[:module] )
  @meta[:class]         = puppet_class_name( options[:class] )
  @meta[:requested_import_filter] = options[:import_filter]
  @meta[:requested_export_filter] = options[:export_filter]
  @meta[:requested_actions]        = options[:action]
  @meta[:logging_mode]             = log_level(options)
  @meta[:command]       = options[:command] 
  @meta[:template_tagged_with]       = options[:template_tagged_with].split(/:/).map(&:to_sym) if options[:template_tagged_with]
  @meta[:debug]         = true if options[:debug]
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



7
8
9
# File 'lib/puppet_generator/task.rb', line 7

def body
  @body
end

#metaObject (readonly)

Returns the value of attribute meta.



6
7
8
# File 'lib/puppet_generator/task.rb', line 6

def meta
  @meta
end