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: 6d7d62089e71ce9f3db03a06f0ed4059f4881d10d0347d1e6126658522e4b20a
4
- data.tar.gz: fd715efeeedba34c02d1053488ccdcc48b2fed441a71494e73ce597f85d1bb03
3
+ metadata.gz: 545efabfadf38b9d05bed12992e6a0f4b51602276969ad025133380740698cd5
4
+ data.tar.gz: 97e9673b779ba30f81061dce6ef8adcb79d64a75b094d599112f48eb32008daa
5
5
  SHA512:
6
- metadata.gz: d6657e9ae4ae1b1ec267ce493a8983c0cf4607bbd7c332c9ed09122d10a5fa76a4ead3270d5e251bb55bd880db568a6163500bc8690d371c4b815e2386c2c4d2
7
- data.tar.gz: ebd59ee073683c103397246b8b67a05f58bbc5c188727f569e54ddf2543e276a00309f61ad83b9a474c7d844b62df39645630b82aa9bb65911d4d869e82ddd59
6
+ metadata.gz: 71229f94701e71c488b08846d8c35ec41401e306bb7d54bd43458f94942a897c66dd96458dd8b4701080be6f9a233aeaa08da503247d388f78f919eb31367b28
7
+ data.tar.gz: bb59f70f3156c3722613535a1bba04ef5e4cfd2aa77530d9c0944320730fe6d4cbb9b6d112feb5a8d1c89ef3a9be16f8a668a291026e93fda76b41c29095c7a4
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.1
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
- def status name, *args
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} #{res}", :black)
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}] #{res}", :red)
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
@@ -1,4 +1,4 @@
1
1
  module ConfigmonkeyCli
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  UPDATE_URL = "https://raw.githubusercontent.com/2called-chaos/configmonkey_cli/master/VERSION"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: configmonkey_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sven Pachnit