require 'tap/generator/base' <% redirect do |target| %># <%= const.const_name %>::generator # # <%= const.name %> Documentation class <%= const.name %> < Tap::Generator::Base config :key, 'value' # a sample config # The generator will receive the inputs on the command line, and # m, a Manifest object that records the actions of this method. def manifest(m, *inputs) # make a directory # m.directory path # make a file # m.file path do |file| # file << content # end # template a file in the templates directory using ERB. # The last argument defines a hash of local variables # for use in the template (here config is used). m.template "<%= const.const_name.underscore %>_file.txt", "template_file.erb", config.to_hash end end <% module_nest(const.nesting, ' ') { target } end %>