morpheus-cli 3.4.0 → 3.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/morpheus/cli/cli_command.rb +2 -0
- data/lib/morpheus/cli/version.rb +1 -1
- data/lib/morpheus/ext/hash.rb +24 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1cae9fa383e2f3e2f683d95e78b90e851ac67808
|
4
|
+
data.tar.gz: 28a8fc238051fec391131d076d45e065af42e7f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 336714794aad079df0bd46bcd8da9d5981575dff8c960217e20f3f7647337b964b0ceb510cd8a03cec61d67414acfb416b16a6426c1a83944d5a062a195e1a1a
|
7
|
+
data.tar.gz: 610d960440d705699df69bb7c700cd0edc979e487fe34707393b924d0c751c23dffc590bd83ae08373a133dbcc72a00ef7c2c325eb5a704e525005f4df68917b
|
@@ -215,6 +215,8 @@ module Morpheus
|
|
215
215
|
else
|
216
216
|
custom_options[custom_option_args[0]] = custom_option_args[1]
|
217
217
|
end
|
218
|
+
# convert "true","on" and "false","off" to true and false
|
219
|
+
custom_options.booleanize!
|
218
220
|
options[:options] = custom_options
|
219
221
|
end
|
220
222
|
opts.on('-N','--no-prompt', "Skip prompts. Use default values for all optional fields.") do |val|
|
data/lib/morpheus/cli/version.rb
CHANGED
data/lib/morpheus/ext/hash.rb
CHANGED
@@ -61,4 +61,28 @@ class Hash
|
|
61
61
|
self
|
62
62
|
end
|
63
63
|
|
64
|
+
# convert recognizable strings to booleans
|
65
|
+
def booleanize!(true_values=['true','on'], false_values=['false','off'])
|
66
|
+
self.each_pair do |k, v|
|
67
|
+
if v.is_a?(Hash)
|
68
|
+
self[k].booleanize!
|
69
|
+
elsif v.is_a?(Array)
|
70
|
+
self[k].each do |it|
|
71
|
+
if it.is_a?(Hash)
|
72
|
+
it.booleanize!
|
73
|
+
elsif self[k] == nil || self[k] == ''
|
74
|
+
# meh, preserve 'empty' array elements
|
75
|
+
end
|
76
|
+
end
|
77
|
+
else
|
78
|
+
if true_values.include?(v)
|
79
|
+
self[k] = true
|
80
|
+
elsif false_values.include?(v)
|
81
|
+
self[k] = false
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
self
|
86
|
+
end
|
87
|
+
|
64
88
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: morpheus-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.4.
|
4
|
+
version: 3.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Estes
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2018-06-
|
14
|
+
date: 2018-06-15 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: bundler
|