configmonkey_cli 1.0.1 → 1.0.2
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 545efabfadf38b9d05bed12992e6a0f4b51602276969ad025133380740698cd5
|
4
|
+
data.tar.gz: 97e9673b779ba30f81061dce6ef8adcb79d64a75b094d599112f48eb32008daa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71229f94701e71c488b08846d8c35ec41401e306bb7d54bd43458f94942a897c66dd96458dd8b4701080be6f9a233aeaa08da503247d388f78f919eb31367b28
|
7
|
+
data.tar.gz: bb59f70f3156c3722613535a1bba04ef5e4cfd2aa77530d9c0944320730fe6d4cbb9b6d112feb5a8d1c89ef3a9be16f8a668a291026e93fda76b41c29095c7a4
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.2
|
@@ -232,6 +232,19 @@ module ConfigmonkeyCli
|
|
232
232
|
thor.say((color.any? ? c(str.to_s, *color) : str.to_s))
|
233
233
|
end
|
234
234
|
|
235
|
+
def status name, *args
|
236
|
+
case args.length
|
237
|
+
when 0
|
238
|
+
raise ArgumentError("at least name and string is required")
|
239
|
+
when 1 # status :fake, rel(@destination)
|
240
|
+
thor.say_status name, args[0], :green
|
241
|
+
when 2 # status :fake, :green, rel(@destination)
|
242
|
+
thor.say_status name, args[1], args[0]
|
243
|
+
when 3 # status :fake, :green, rel(@destination), :red
|
244
|
+
thor.say_status name, thor.set_color(args[1], *args[2..-1]), args[0]
|
245
|
+
end
|
246
|
+
end
|
247
|
+
|
235
248
|
# do block no matter the `hostname`
|
236
249
|
def all &block
|
237
250
|
_with_constraint(:any, &block)
|
@@ -53,20 +53,7 @@ module ConfigmonkeyCli
|
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
56
|
-
|
57
|
-
case args.length
|
58
|
-
when 0
|
59
|
-
raise ArgumentError("at least name and string is required")
|
60
|
-
when 1 # status :fake, rel(@destination)
|
61
|
-
thor.say_status name, args[0], :green
|
62
|
-
when 2 # status :fake, :green, rel(@destination)
|
63
|
-
thor.say_status name, args[1], args[0]
|
64
|
-
when 3 # status :fake, :green, rel(@destination), :red
|
65
|
-
thor.say_status name, thor.set_color(args[1], *args[2..-1]), args[0]
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
([:padded, :c, :say, :ask, :yes?, :no?] + Manifest::MANIFEST_ACTIONS).each do |meth|
|
56
|
+
([:padded, :c, :say, :status, :ask, :yes?, :no?] + Manifest::MANIFEST_ACTIONS).each do |meth|
|
70
57
|
define_method(meth) do |*args, &block|
|
71
58
|
manifest.send(meth, *args, &block)
|
72
59
|
end
|
@@ -20,10 +20,13 @@ module ConfigmonkeyCli
|
|
20
20
|
code, res = exec(@args[0], @opts[:chomp])
|
21
21
|
|
22
22
|
if opts[:echo]
|
23
|
+
lines = res.split("\n")
|
23
24
|
if code.exitstatus.zero?
|
24
|
-
say padded("#{c "[OK]", :green} #{
|
25
|
+
say padded("#{c "[OK]", :green} #{lines[0]}", :black)
|
26
|
+
lines[1..-1].each{|l| say padded(" #{l}") }
|
25
27
|
else
|
26
|
-
say padded("[#{code.exitstatus}] #{
|
28
|
+
say padded("[#{code.exitstatus}] #{lines[0]}", :red)
|
29
|
+
lines[1..-1].each{|l| say padded(" #{l}") }
|
27
30
|
raise "Invoked process exited with status #{code.exitstatus}: #{res}" if opts[:fail]
|
28
31
|
end
|
29
32
|
end
|