Class: Kanagata::CLI

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

Instance Method Summary collapse

Instance Method Details

#destroy(target, *attributes) ⇒ Object



27
28
29
30
31
32
33
34
# File 'lib/kanagata/cli.rb', line 27

def destroy(target, *attributes)
  begin
    destroyer = Kanagata::Destroyer.new(target, options[:config], attributes)
    destroyer.destroy
  rescue => e
    say(e.message, :red)
  end
end

#generate(target, *attributes) ⇒ Object



16
17
18
19
20
21
22
23
# File 'lib/kanagata/cli.rb', line 16

def generate(target, *attributes)
  begin
    generator = Kanagata::Generator.new(target, options[:config], attributes)
    generator.generate
  rescue => e
    say(e.message, :red)
  end
end

#init(target = 'sample') ⇒ Object



6
7
8
9
10
11
12
# File 'lib/kanagata/cli.rb', line 6

def init(target = 'sample')
  begin
    skelton = Kanagata::Skelton.new(target)
  rescue => e
    say(e.message, :red)
  end
end