module Thor::Actions
def template(source, destination=nil, config={})
template "doc/README"
template "README", "doc/README"
==== Examples
config
destination
source
==== Parameters
to be equal to the source removing .tt from the filename.
at the relative destination. If the destination is not given it's assumed
Gets an ERB template at the relative source, executes it and makes a copy
def template(source, destination=nil, config={}) destination ||= source source = File.expand_path(find_in_source_paths(source.to_s)) context = instance_eval('binding') create_file destination, nil, config do ERB.new(::File.read(source), nil, '-').result(context) end end