Class: Tap::Generator::Generators::Command

Inherits:
Base
  • Object
show all
Defined in:
lib/tap/generator/generators/command.rb

Overview

:startdoc::generator a new tap command

Generates a new tap command under the cmd directory. The

new command can be run from the command line using:

% tap <command>

Instance Attribute Summary

Attributes inherited from Base

#prompt_in, #prompt_out, #template_dir

Instance Method Summary collapse

Methods inherited from Base

#action, #directories, #directory, #file, #initialize, #iterate, #log_relative, #on, #path, #process, #set, #template, #template_files

Constructor Details

This class inherits a constructor from Tap::Generator::Base

Instance Method Details

#manifest(m, command_name) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/tap/generator/generators/command.rb', line 13

def manifest(m, command_name)
  m.directory path('cmd')
  
  template_files do |source, target|
    m.template path('cmd', "#{command_name}.rb"), source, :command_name => command_name
  end
end