Class: PuppetGenerator::Setup::File

Inherits:
Bare
  • Object
show all
Defined in:
lib/puppet_generator/setup/file.rb

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ File

Returns a new instance of File.



5
6
7
# File 'lib/puppet_generator/setup/file.rb', line 5

def initialize(options)
  super
end

Instance Method Details

#create_taskObject



22
23
24
25
26
# File 'lib/puppet_generator/setup/file.rb', line 22

def create_task
  Task.new(
    HashWithIndifferentAccess.new( { command: :file } ).merge @options
  )
end

#setup_environmentObject



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/puppet_generator/setup/file.rb', line 9

def setup_environment
  DefaultErrorMessages.use
  DefaultImportFilter.use
  DefaultActions.use
  DefaultImporter.use
  DefaultExportFilter.use

  Models::Action.enable :copy_files_to_module_directory
  Models::Template.find_all(:file).collect { |t| t.enable }
  Models::ExportFilter.enable :filesystem_attributes
  Models::Importer.enable :directory
end