Class: Jets::Commands::Main
- Inherits:
-
Base
show all
- Defined in:
- lib/jets/commands/main.rb
Instance Method Summary
collapse
Methods inherited from Base
autocomplete, banner, dispatch, eager_load!, help_list, inherited, klass_from_namespace, namespace_from_class, namespaced_commands, perform, special_class_map, subclasses
Instance Method Details
#build ⇒ Object
11
12
13
|
# File 'lib/jets/commands/main.rb', line 11
def build
Build.new(options).run
end
|
#call(function_name, payload = '') ⇒ Object
86
87
88
89
90
91
92
93
94
95
96
97
98
|
# File 'lib/jets/commands/main.rb', line 86
def call(function_name, payload='')
$stdout.sync = true
$stderr.sync = true
$stdout = $stderr Call.new(function_name, payload, options).run
end
|
#console ⇒ Object
60
61
62
|
# File 'lib/jets/commands/main.rb', line 60
def console
Console.run
end
|
#dbconsole ⇒ Object
72
73
74
|
# File 'lib/jets/commands/main.rb', line 72
def dbconsole
Dbconsole.start(*args)
end
|
#delete(environment = nil) ⇒ Object
Note the environment is here to trick the Thor parser to allowing an environment parameter. It is not actually set here. It is set earlier in cli.rb: set_jets_env_from_cli_arg!
31
32
33
|
# File 'lib/jets/commands/main.rb', line 31
def delete(environment=nil)
Delete.new(options).run
end
|
#deploy(environment = nil) ⇒ Object
Note the environment is here to trick the Thor parser to allowing an environment parameter. It is not actually set here. It is set earlier in cli.rb: set_jets_env_from_cli_arg!
20
21
22
|
# File 'lib/jets/commands/main.rb', line 20
def deploy(environment=nil)
Deploy.new(options).run
end
|
#generate(generator, *args) ⇒ Object
102
103
104
|
# File 'lib/jets/commands/main.rb', line 102
def generate(generator, *args)
Jets::Generator.invoke(generator, *args)
end
|
#middleware ⇒ Object
126
127
128
129
130
131
132
|
# File 'lib/jets/commands/main.rb', line 126
def middleware
stack = Jets.application.middlewares
stack.middlewares.each do |middleware|
puts "use #{middleware.name}"
end
puts "run #{Jets.application.endpoint}"
end
|
#runner(code) ⇒ Object
66
67
68
|
# File 'lib/jets/commands/main.rb', line 66
def runner(code)
Runner.run(code)
end
|
#secret ⇒ Object
120
121
122
|
# File 'lib/jets/commands/main.rb', line 120
def secret
puts SecureRandom.hex(64)
end
|
#server ⇒ Object
40
41
42
43
44
45
46
47
48
49
50
|
# File 'lib/jets/commands/main.rb', line 40
def server
o = options
server_command = o[:reload] ? "shotgun" : "rackup"
command = "bundle exec #{server_command} --port #{o[:port]} --host #{o[:host]}"
puts "=> #{command}".colorize(:green)
puts Jets::Booter.message
Jets::Booter.check_config_ru!
Jets::RackServer.start(options) unless ENV['JETS_RACK'] == '0' system(command)
end
|
#status ⇒ Object
108
109
110
|
# File 'lib/jets/commands/main.rb', line 108
def status
Jets::Cfn::Status.new(options).run
end
|
#version ⇒ Object
142
143
144
|
# File 'lib/jets/commands/main.rb', line 142
def version
puts Jets.version
end
|