Class: Tzispa::Commands::Cli::Generate

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

Instance Method Summary collapse

Instance Method Details

#api(name) ⇒ Object



51
52
53
54
55
# File 'lib/tzispa/commands/cli/generate.rb', line 51

def api(name)
  hnd = Tzispa::Commands::Api.new(name, options[:app], options[:verb])
  hnd.generate
  puts "Api handler '#{name}' has been created in #{options[:app]}"
end

#app(name) ⇒ Object



15
16
17
18
19
# File 'lib/tzispa/commands/cli/generate.rb', line 15

def app(name)
  tzapp = Tzispa::Commands::App.new(name)
  tzapp.generate(options[:mount], options[:index], options[:locale])
  puts "App '#{name}' has been created"
end

#repository(name) ⇒ Object



39
40
41
42
43
# File 'lib/tzispa/commands/cli/generate.rb', line 39

def repository(name)
  repo = Tzispa::Commands::Repository.new name, options[:adapter], options[:database]
  repo.generate
  puts "Repository #{name} has been created into local project"
end

#rig(name) ⇒ Object



27
28
29
30
31
# File 'lib/tzispa/commands/cli/generate.rb', line 27

def rig(name)
  tpl = Tzispa::Commands::Rig.new(name, options[:app], options[:type])
  tpl.generate
  puts "Rig #{options[:type]} template '#{name}' has been created in #{options[:app]}"
end