Class: Producer::Core::Actions::FileWriter
Constant Summary
Producer::Core::Action::INSPECT_ARGUMENTS_SUM_LEN
Instance Attribute Summary
#arguments, #env, #options
Instance Method Summary
collapse
#initialize, #to_s
Instance Method Details
#apply ⇒ Object
16
17
18
19
|
# File 'lib/producer/core/actions/file_writer.rb', line 16
def apply
fs.file_write @path, @content
fs.setstat @path, @options unless @options.empty?
end
|
#name ⇒ Object
12
13
14
|
# File 'lib/producer/core/actions/file_writer.rb', line 12
def name
'file_write'
end
|
#setup ⇒ Object
5
6
7
8
9
10
|
# File 'lib/producer/core/actions/file_writer.rb', line 5
def setup
check_arguments_size! arguments_size
@path, @content = arguments
@options[:permissions] = @options.delete :mode if options.key? :mode
@options[:owner] = @options.delete :user if options.key? :user
end
|