Class: EtnaApp
Defined Under Namespace
Classes: Administrate, Config, Console, CreateTemplate, Polyphemus
Instance Attribute Summary
#logger
Class Method Summary
collapse
Instance Method Summary
collapse
#config, #configure, #env_config, find, #find_descendents, #id, included, #initialize, instance, register, #run_command, #setup_logger, #sign
Class Method Details
.config_file_path ⇒ Object
9
10
11
|
# File 'lib/commands.rb', line 9
def self.config_file_path
File.join(Dir.home, 'etna.yml')
end
|
Instance Method Details
#dispatch_to_subcommand(cmd = 'help', *args, environment: nil, **kwds) ⇒ Object
15
16
17
18
|
# File 'lib/commands.rb', line 15
def dispatch_to_subcommand(cmd = 'help', *args, environment: nil, **kwds)
set_environment(environment)
super(cmd, *args, **kwds)
end
|
#environment ⇒ Object
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/commands.rb', line 20
def environment
if @environment
@environment
elsif @config && @config.is_a?(Hash) && @config.keys.length == 1
@config.keys.last.to_sym
elsif @config && @config.is_a?(Hash) && @config.keys.length > 1
:many
else
:none
end
end
|
#set_environment(env) ⇒ Object
32
33
34
|
# File 'lib/commands.rb', line 32
def set_environment(env)
@environment = env.nil? ? nil : env.to_sym
end
|