Class: Lotus::Cli

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/lotus/cli.rb

Overview

Since:

  • 0.1.0

Instance Method Summary collapse

Instance Method Details

#consoleObject

Since:

  • 0.1.0



41
42
43
44
45
46
47
48
# File 'lib/lotus/cli.rb', line 41

def console
  if options[:help]
    invoke :help, ['console']
  else
    require 'lotus/commands/console'
    Lotus::Commands::Console.new(environment).start
  end
end

#generate(type = nil, app_name = nil, name = nil) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.3.0



92
93
94
95
96
97
98
99
# File 'lib/lotus/cli.rb', line 92

def generate(type = nil, app_name = nil, name = nil)
  if options[:help] || (type.nil? && app_name.nil? && name.nil?)
    invoke :help, ['generate']
  else
    require 'lotus/commands/generate'
    Lotus::Commands::Generate.new(type, app_name, name, environment, self).start
  end
end

#new(name = nil) ⇒ Object

Since:

  • 0.1.0



73
74
75
76
77
78
79
80
# File 'lib/lotus/cli.rb', line 73

def new(name = nil)
  if options[:help] || name.nil?
    invoke :help, ['new']
  else
    require 'lotus/commands/new'
    Lotus::Commands::New.new(name, environment, self).start
  end
end

#routesObject

Since:

  • 0.1.0



54
55
56
57
58
59
60
61
# File 'lib/lotus/cli.rb', line 54

def routes
  if options[:help]
    invoke :help, ['routes']
  else
    require 'lotus/commands/routes'
    Lotus::Commands::Routes.new(environment).start
  end
end

#serverObject

Since:

  • 0.1.0



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

def server
  if options[:help]
    invoke :help, ['server']
  else
    require 'lotus/commands/server'
    Lotus::Commands::Server.new(environment).start
  end
end

#versionObject

Since:

  • 0.1.0



10
11
12
# File 'lib/lotus/cli.rb', line 10

def version
  puts "v#{ Lotus::VERSION }"
end