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, 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
97
98
99
100
101
102
103
104
105
106
107
108
109
|
# File 'lib/jets/commands/main.rb', line 97
def call(function_name, payload='')
$stdout.sync = true
$stderr.sync = true
$stdout = $stderr Call.new(function_name, payload, options).run
end
|
17
18
19
|
# File 'lib/jets/commands/main.rb', line 17
def configure(token=nil)
Configure.new(options.merge(token: token)).run
end
|
#console(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!
69
70
71
|
# File 'lib/jets/commands/main.rb', line 69
def console(environment=nil)
Console.new(options).run
end
|
#dbconsole ⇒ Object
81
82
83
|
# File 'lib/jets/commands/main.rb', line 81
def dbconsole
Dbconsole.start(*args)
end
|
#degenerate(generator, *args) ⇒ Object
119
120
121
|
# File 'lib/jets/commands/main.rb', line 119
def degenerate(generator, *args)
Jets::Generator.revoke(generator, *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!
37
38
39
|
# File 'lib/jets/commands/main.rb', line 37
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!
26
27
28
|
# File 'lib/jets/commands/main.rb', line 26
def deploy(environment=nil)
Deploy.new(options).run
end
|
#generate(generator, *args) ⇒ Object
113
114
115
|
# File 'lib/jets/commands/main.rb', line 113
def generate(generator, *args)
Jets::Generator.invoke(generator, *args)
end
|
#middleware ⇒ Object
143
144
145
146
147
148
149
|
# File 'lib/jets/commands/main.rb', line 143
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
75
76
77
|
# File 'lib/jets/commands/main.rb', line 75
def runner(code)
Runner.run(code)
end
|
#secret ⇒ Object
137
138
139
|
# File 'lib/jets/commands/main.rb', line 137
def secret
puts SecureRandom.hex(64)
end
|
#server ⇒ Object
45
46
47
48
49
50
51
52
53
54
55
|
# File 'lib/jets/commands/main.rb', line 45
def server
o = options
command = "bundle exec rackup --port #{o[:port]} --host #{o[:host]}"
puts "=> #{command}".color(:green)
puts Jets::Booter.message
Jets::Booter.check_config_ru!
Jets::RackServer.start(options) unless ENV['JETS_RACK'] == '0' Bundler.with_unbundled_env do
system(command)
end
end
|
#status ⇒ Object
125
126
127
|
# File 'lib/jets/commands/main.rb', line 125
def status
Jets::Cfn::Status.new(options).run
end
|
#version ⇒ Object
159
160
161
|
# File 'lib/jets/commands/main.rb', line 159
def version
puts Jets.version
end
|