Class: Producer::Core::Actions::FileAppend
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
14
15
16
|
# File 'lib/producer/core/actions/file_append.rb', line 14
def apply
fs.file_write @path, combined_content
end
|
#combined_content ⇒ Object
18
19
20
21
22
23
|
# File 'lib/producer/core/actions/file_append.rb', line 18
def combined_content
original_content = fs.file_read @path
return @content unless original_content
original_content + @content
end
|
#name ⇒ Object
10
11
12
|
# File 'lib/producer/core/actions/file_append.rb', line 10
def name
'file_append'
end
|
#setup ⇒ Object
5
6
7
8
|
# File 'lib/producer/core/actions/file_append.rb', line 5
def setup
check_arguments_size! 2
@path, @content = arguments
end
|