Module: Gram::Gem

Defined in:
lib/gram/gem.rb,
lib/gram/gem/generator.rb

Defined Under Namespace

Classes: Generator

Constant Summary collapse

ACTIONS =
{ create: { 
    description: "Creates a new gem with the given NAME",
    arguments: %w(NAME [--rails]),
    },
}

Class Method Summary collapse

Class Method Details



12
13
14
15
16
17
18
# File 'lib/gram/gem.rb', line 12

def banner
  out = "Available actions:\n"
  ACTIONS.each_pair do |action, |
    out << "\n\t#{action} #{[:arguments].join(' ')}\t\t#{[:description]}"
  end
  out
end

.create(name, *options) ⇒ Object

ACTIONS



22
23
24
25
26
# File 'lib/gram/gem.rb', line 22

def create(name, *options)
  puts "Gram::Gem generating gem scaffold for #{name}..."
  Generator.new.generate(name, options)
  puts "Generated on ./#{name} :)"
end