Class: Producer::Core::Actions::FileWriter

Inherits:
Producer::Core::Action show all
Defined in:
lib/producer/core/actions/file_writer.rb

Constant Summary

Constants inherited from Producer::Core::Action

Producer::Core::Action::INSPECT_ARGUMENTS_SUM_LEN

Instance Attribute Summary

Attributes inherited from Producer::Core::Action

#arguments, #env, #options

Instance Method Summary collapse

Methods inherited from Producer::Core::Action

#initialize, #to_s

Constructor Details

This class inherits a constructor from Producer::Core::Action

Instance Method Details

#applyObject



15
16
17
18
# File 'lib/producer/core/actions/file_writer.rb', line 15

def apply
  fs.file_write @path, @content
  fs.setstat @path, options unless options.empty?
end

#nameObject



11
12
13
# File 'lib/producer/core/actions/file_writer.rb', line 11

def name
  'file_write'
end

#setupObject



5
6
7
8
9
# File 'lib/producer/core/actions/file_writer.rb', line 5

def setup
  check_arguments_size! 2
  @path, @content = arguments
  convert_options mode: :permissions, user: :owner
end