Method: Thor::Actions#insert_into_file

Defined in:
lib/thor/actions/inject_into_file.rb

#insert_into_file(destination, *args, &block) ⇒ Object Also known as: inject_into_file

[View source]

26
27
28
29
30
31
32
33
# File 'lib/thor/actions/inject_into_file.rb', line 26

def insert_into_file(destination, *args, &block)
  data = block_given? ? block : args.shift

  config = args.shift || {}
  config[:after] = /\z/ unless config.key?(:before) || config.key?(:after)

  action InjectIntoFile.new(self, destination, data, config)
end