bogo-cli 0.1.20 → 0.1.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/bogo-cli/command.rb +12 -4
- data/lib/bogo-cli/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: acd52ffa30759ad9440c86ea5b919da900aab8ee
|
4
|
+
data.tar.gz: 66c23dd1d5c282dbf55fec2e51a9256926bae158
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5fa6e498163fed36510646ce599c1be0b948d2339a972aff985986727f7d50b64358808ec20426c57f41e7137473a33373e8311827aa907ccc61b21a62416ef8
|
7
|
+
data.tar.gz: a08e2273c046137d1319a50e0de07332cdfe0606e6e3db29584a3028dc568a1852fe2f4b06c6ae82dcd3e6f3187fb020b7d83247f12acc16354deb151e077904
|
data/CHANGELOG.md
CHANGED
data/lib/bogo-cli/command.rb
CHANGED
@@ -21,6 +21,7 @@ module Bogo
|
|
21
21
|
# @return [self]
|
22
22
|
def initialize(cli_opts, args)
|
23
23
|
@options = cli_opts.to_hash.to_smash(:snake)
|
24
|
+
@options.delete_if{|k,v| v.nil?}
|
24
25
|
@arguments = args
|
25
26
|
ui_args = Smash.new(
|
26
27
|
:app_name => options.fetch(:app_name,
|
@@ -72,22 +73,29 @@ module Bogo
|
|
72
73
|
# @return [Hash]
|
73
74
|
def load_config!
|
74
75
|
if(options[:config])
|
75
|
-
|
76
|
+
config_inst = config_class.new(options[:config])
|
76
77
|
elsif(self.class.const_defined?(:DEFAULT_CONFIGURATION_FILES))
|
77
78
|
path = self.class.const_get(:DEFAULT_CONFIGURATION_FILES).detect do |check|
|
78
79
|
full_check = File.expand_path(check)
|
79
80
|
File.exists?(full_check)
|
80
81
|
end
|
81
|
-
|
82
|
+
config_inst = config_class.new(path) if path
|
82
83
|
end
|
83
|
-
|
84
|
+
new_opts = config_class.new(options)
|
85
|
+
@options = new_opts.to_smash
|
86
|
+
if(config_inst)
|
84
87
|
merge_opts = Smash[options.to_smash.map{|k,v| [k,v] unless v.nil?}.compact]
|
85
88
|
merge_opts.delete(:config)
|
86
|
-
@options =
|
89
|
+
@options = config_inst.to_smash.deep_merge(merge_opts)
|
87
90
|
end
|
88
91
|
options
|
89
92
|
end
|
90
93
|
|
94
|
+
# @return [Class] config class
|
95
|
+
def config_class
|
96
|
+
Bogo::Config
|
97
|
+
end
|
98
|
+
|
91
99
|
# Wrap action within nice text. Output resulting Hash if provided
|
92
100
|
#
|
93
101
|
# @param msg [String] message of action in progress
|
data/lib/bogo-cli/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bogo-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Roberts
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bogo
|
@@ -106,4 +106,3 @@ signing_key:
|
|
106
106
|
specification_version: 4
|
107
107
|
summary: CLI Helper libraries
|
108
108
|
test_files: []
|
109
|
-
has_rdoc:
|