module Thor::Actions
def append_to_file(path, *args, &block)
end
'config.gem "rspec"'
append_to_file 'config/environments/test.rb' do
append_to_file 'config/environments/test.rb', 'config.gem "rspec"'
==== Example
config
data
path
==== Parameters
Append text to a file. Since it depends on insert_into_file, it's reversible.
def append_to_file(path, *args, &block) config = args.last.is_a?(Hash) ? args.pop : {} config.merge!(:before => /\z/) insert_into_file(path, *(args << config), &block) end