Sha256: 5061ddb8daddf77aaa32f37d716cc1cd5234b4cb2238296f114b54988c7a8219

Contents?: true

Size: 1001 Bytes

Versions: 3

Compression:

Stored size: 1001 Bytes

Contents

require 'tap/generator/base'

<% redirect do |target| %># :startdoc::generator <replace with summary>
# <replace with description>

# <%= 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
    
    # do something only on generate/destroy
    # on(:generate) {}
  end
  
end <% module_nest(const.nesting, '  ') { target } end %>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
tap-gen-0.8.0 templates/tap/generator/generators/generator/resource.erb
tap-gen-0.7.1 templates/tap/generator/generators/generator/resource.erb
tap-gen-0.7.0 templates/tap/generator/generators/generator/resource.erb