Class: Slnky::CLI::Generate

Inherits:
Thor
  • Object
show all
Defined in:
lib/slnky/cli/generate.rb

Instance Method Summary collapse

Instance Method Details

#command(name, dir = nil) ⇒ Object

Raises:

  • (Thor::Error)


12
13
14
15
# File 'lib/slnky/cli/generate.rb', line 12

def command(name, dir=nil)
  raise Thor::Error, "not implemented"
  # Slnky::Generator::Command.new(name, dir).generate
end

#service(name, dir = nil) ⇒ Object

Raises:

  • (Thor::Error)


5
6
7
8
9
# File 'lib/slnky/cli/generate.rb', line 5

def service(name, dir=nil)
  generator = Slnky::Generator::Service.new(name, dir)
  raise Thor::Error, "error: directory '#{generator.dir}' exists" if File.exists?(generator.dir)
  generator.generate
end