Module: Rbcli
- Defined in:
- lib/rbcli.rb,
lib/rbcli/version.rb,
lib/rbcli/engine/parser.rb,
lib/rbcli/features/logging.rb,
lib/rbcli/engine/load_project.rb,
lib/rbcli/features/userconfig.rb,
lib/rbcli/state_storage/localstate.rb,
lib/rbcli/configuration/configurate.rb,
lib/rbcli/state_storage/placeholders.rb,
lib/rbcli/state_storage/remotestate_dynamodb.rb
Overview
Defined Under Namespace
Modules: Autoupdate, CmdLibrary, Config, Configurable, Configurate, Logger, Msg, Parser, State
Classes: Command, DeprecationWarning, RemoteExec, Scriptwrapper
Constant Summary
collapse
- VERSION =
'0.2.9'
Class Method Summary
collapse
Class Method Details
.config ⇒ Object
54
55
56
|
# File 'lib/rbcli/features/userconfig.rb', line 54
def self.config
Rbcli::Config::config
end
|
.configuration(mod, key = nil) ⇒ Object
77
78
79
80
81
82
83
84
|
# File 'lib/rbcli/configuration/configurate.rb', line 77
def self.configuration mod, key = nil
begin
d = Rbcli::Configurate.const_get(mod.to_s.capitalize.to_sym).data
(key.nil?) ? d : d[key]
rescue
nil
end
end
|
.debug(obj) ⇒ Object
95
96
97
|
# File 'lib/rbcli/features/logging.rb', line 95
def self.debug obj
puts obj.to_s.red
end
|
.load_project ⇒ Object
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
# File 'lib/rbcli/engine/load_project.rb', line 23
def self.load_project
project_root = File.expand_path("#{File.dirname(caller[0].split(':')[0])}/../")
lib = "#{project_root}/lib"
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
%w(config hooks application application/commands).each do |dir|
dirpath = "#{project_root}/#{dir}"
Dir.glob "#{dirpath}/*.rb" do |file|
require file
end if Dir.exists? dirpath
end
configspath = "#{project_root}/userconf"
Dir.glob "#{configspath}/*.{yml,yaml,json}" do |file|
Rbcli::Configurate.me {config_defaults file}
end
end
|
.local_state ⇒ Object
27
28
29
|
# File 'lib/rbcli/state_storage/localstate.rb', line 27
def self.local_state
Rbcli.configuration(:storage, :localstate)
end
|
.log ⇒ Object
91
92
93
|
# File 'lib/rbcli/features/logging.rb', line 91
def self.log
Rbcli::Logger::log
end
|
.remote_state ⇒ Object
26
27
28
|
# File 'lib/rbcli/state_storage/placeholders.rb', line 26
def self.remote_state
raise Exception.new "Warning: Usage of Remote State requires Remote State Storage to be enabled in your application's configuration."
end
|