Module: Rbcli
- Defined in:
- lib/rbcli.rb,
lib/rbcli/version.rb,
lib/rbcli/configurate.rb,
lib/rbcli/util/config.rb,
lib/rbcli/util/logging.rb,
lib/rbcli/engine/parser.rb,
lib/rbcli/stateful_systems/storagetypes/localstate.rb,
lib/rbcli/stateful_systems/storagetypes/remotestate_dynamodb.rb
Overview
Defined Under Namespace
Modules: Config, Configurate, ConfigurateStorage, Logger, Parser, State
Classes: Command
Constant Summary
collapse
- VERSION =
"0.1.4"
Class Method Summary
collapse
Class Method Details
.config ⇒ Object
34
35
36
|
# File 'lib/rbcli/util/config.rb', line 34
def self.config
Rbcli::Config::config
end
|
.configuration ⇒ Object
104
105
106
|
# File 'lib/rbcli/configurate.rb', line 104
def self.configuration
Rbcli::Configurate::configuration
end
|
.debug(obj) ⇒ Object
70
71
72
|
# File 'lib/rbcli/util/logging.rb', line 70
def self.debug obj
puts obj.to_s.red
end
|
.local_state ⇒ Object
15
16
17
|
# File 'lib/rbcli/stateful_systems/storagetypes/localstate.rb', line 15
def self.local_state
Rbcli::ConfigurateStorage.data[:localstate]
end
|
.log ⇒ Object
66
67
68
|
# File 'lib/rbcli/util/logging.rb', line 66
def self.log
Rbcli::Logger::log
end
|
.parse ⇒ Object
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
# File 'lib/rbcli/engine/parser.rb', line 61
def self.parse
if Rbcli.configuration[:first_run]
if Rbcli.local_state
if Rbcli.local_state.rbclidata.key? :first_run
Rbcli::Parser::parse
else
Rbcli.configuration[:first_run].call
Rbcli.local_state.set_rbclidata :first_run, true
Rbcli::Parser::parse unless Rbcli.configuration[:halt_after_first_run]
end
else
raise StandardError.new "Error: Can not use `first_run` without also configuring `local_state`."
end
else
Rbcli::Parser::parse
end
end
|
.remote_state ⇒ Object
19
20
21
|
# File 'lib/rbcli/stateful_systems/storagetypes/remotestate_dynamodb.rb', line 19
def self.remote_state
Rbcli::ConfigurateStorage.data[:remotestate]
end
|