Module: Card::Generators::ClassMethods

Included in:
MigrationBase, NamedBase
Defined in:
lib/generators/card.rb

Instance Method Summary collapse

Instance Method Details

Override Rails default banner (decko is the command name).



21
22
23
24
25
# File 'lib/generators/card.rb', line 21

def banner
  usage_arguments = arguments.map(&:usage) * " "
  text = "decko generate #{namespace} #{usage_arguments} [options]"
  text.gsub(/\s+/, " ")
end

#source_root(path = nil) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/generators/card.rb', line 9

def source_root path=nil
  if path
    @_card_source_root = path
  else
    @_card_source_root ||= File.expand_path(
      File.join(File.dirname(__FILE__),
                "card", generator_name, "templates")
    )
  end
end