module Thor::Actions
def append_file(path, data=nil, config={}, &block)
append_file 'config/environments/test.rb', 'config.gem "rspec"'
==== Example
config
data
path
==== Parameters
Append text to a file.
def append_file(path, data=nil, config={}, &block) return unless behavior == :invoke path = File.expand_path(path, destination_root) say_status :append, relative_to_original_destination_root(path), config.fetch(:verbose, true) File.open(path, 'ab') { |file| file.write(data || block.call) } unless options[:pretend] end