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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 20e78e38f9bcbdad9a49fd08311ad25c96472067
4
- data.tar.gz: cf420de6d192d9c5514eccd78f17aa4850df4c4b
3
+ metadata.gz: 1cae9fa383e2f3e2f683d95e78b90e851ac67808
4
+ data.tar.gz: 28a8fc238051fec391131d076d45e065af42e7f5
5
5
  SHA512:
6
- metadata.gz: 85eb7b4fd8b3a901884495d0b9049c42896ed7f5e2e9292359a936f2895571c0a09527b8324149f9ad211733e18cc9ffb9add5a965ee9619a4bc46e9e0fc182d
7
- data.tar.gz: 06982a9e0a0564147a6781709954c5f55df16438a26652125b8346ee3dc51f95f487d54b153c844038a7f6cfe718d79dde62bc3768f74dea8f25635cad39bc51
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|
@@ -1,6 +1,6 @@
1
1
 
2
2
  module Morpheus
3
3
  module Cli
4
- VERSION = "3.4.0"
4
+ VERSION = "3.4.1"
5
5
  end
6
6
  end
@@ -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.0
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 00:00:00.000000000 Z
14
+ date: 2018-06-15 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler