Class: Slnky::CLI::Generate
- Inherits:
-
Thor
- Object
- Thor
- Slnky::CLI::Generate
- Defined in:
- lib/slnky/cli/generate.rb
Instance Method Summary collapse
Instance Method Details
#command(name, dir = nil) ⇒ Object
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
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 |