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

#new(name = nil) ⇒ Object

Since:

  • 0.1.0



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

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