kdeploy 1.1.1 → 1.1.3

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: 0203e26e85d3910ae62da516f229355cc3c19f360f2dd56abfda06e616195258
4
- data.tar.gz: 20ab1369c1b7906d6fbe51191c7b999e617e65f1572014ada58eb12f52f5b143
3
+ metadata.gz: fb093825d57b14ed8e603e760f2561b6b0e78d3ffb907efd11fbb0a6eddb069e
4
+ data.tar.gz: 679556c416416a010fca552c5dbbf656961dbbd8dc3a90180261a4f4addf9409
5
5
  SHA512:
6
- metadata.gz: 912c3c3eb78ac13a8294f1e1468875bbc45a375701e6312054a51afb37e986eb7bb85061efe16f44a2ed48e2421235b47eedb2f9db6aee8616640e314610bb8c
7
- data.tar.gz: 2e502450ba52305c98b294fd0bde975f494d066e9720bcbd504f13b61a9cc6d21930f0b510874e2e18bc27bb637c6d092401a1e13f9f18503e10febe0b2caa69
6
+ metadata.gz: e03245531beafbb2010b4e00a466aea4e5f756b60628ce2206355387046ae70a2ec0aca1ec1a0e7243a2b240d9cf569168b243a9e67cea637fef0f5e0f26428e
7
+ data.tar.gz: 129aa8dc62528d63bb99d0e60af780fc241691daafeb3fcb51940d4f2355902fca068d3bbcd60c0f2bd487228f859f58145f279c695c813b5f32d0f48ec4fb90
data/lib/kdeploy/cli.rb CHANGED
@@ -188,7 +188,12 @@ module Kdeploy
188
188
  puts pastel.bright_white("\n#{host.ljust(24)} : #{status}")
189
189
 
190
190
  if %i[success changed].include?(result[:status])
191
+ shown = {}
191
192
  result[:output].each do |step|
193
+ key = [step[:command], step[:output]].hash
194
+ next if shown[key]
195
+
196
+ shown[key] = true
192
197
  if step[:command].to_s.start_with?('upload:')
193
198
  puts pastel.green(" [upload] #{step[:command].sub('upload: ', '')}")
194
199
  elsif step[:command].to_s.start_with?('upload_template:')
@@ -197,11 +202,11 @@ module Kdeploy
197
202
  puts pastel.cyan(" [run] #{step[:command].to_s.lines.first.strip}")
198
203
  if step[:output].is_a?(Hash) && step[:output][:stdout]
199
204
  step[:output][:stdout].each_line do |line|
200
- puts " > #{line.strip}" unless line.strip.empty?
205
+ puts " #{line.rstrip}" unless line.strip.empty?
201
206
  end
202
207
  elsif step[:output].is_a?(String)
203
208
  step[:output].each_line do |line|
204
- puts " > #{line.strip}" unless line.strip.empty?
209
+ puts " #{line.rstrip}" unless line.strip.empty?
205
210
  end
206
211
  end
207
212
  end
@@ -222,13 +227,17 @@ module Kdeploy
222
227
  # summary
223
228
  puts pastel.cyan("\nPLAY RECAP #{'*' * 64}")
224
229
  max_host_len = results.keys.map(&:length).max || 16
225
- results.each do |host, result|
230
+ ok_w = 7
231
+ changed_w = 11
232
+ failed_w = 10
233
+ results.keys.sort.each do |host|
234
+ result = results[host]
226
235
  ok = %i[success changed].include?(result[:status]) ? result[:output].size : 0
227
236
  failed = result[:status] == :failed ? 1 : 0
228
237
  changed = result[:status] == :changed ? result[:output].size : 0
229
- ok_str = pastel.green("ok=#{ok.to_s.ljust(3)}")
230
- changed_str = pastel.yellow("changed=#{changed.to_s.ljust(3)}")
231
- failed_str = pastel.red("failed=#{failed.to_s.ljust(3)}")
238
+ ok_str = pastel.green("ok=#{ok.to_s.ljust(ok_w - 3)}")
239
+ changed_str = pastel.yellow("changed=#{changed.to_s.ljust(changed_w - 8)}")
240
+ failed_str = pastel.red("failed=#{failed.to_s.ljust(failed_w - 7)}")
232
241
  line = "#{host.ljust(max_host_len)} : #{ok_str} #{changed_str} #{failed_str}"
233
242
  if failed.positive?
234
243
  puts pastel.red(line)
@@ -55,7 +55,7 @@ module Kdeploy
55
55
  output[:stdout].each_line { |line| puts " #{line.rstrip}" unless line.strip.empty? }
56
56
  end
57
57
  if output[:stderr] && !output[:stderr].empty?
58
- output[:stderr].each_line { |line| puts pastel.red(" #{line.rstrip}") unless line.strip.empty? }
58
+ output[:stderr].each_line { |line| puts pastel.green(" #{line.rstrip}") unless line.strip.empty? }
59
59
  end
60
60
  result[:output] << { command: command[:command], output: output }
61
61
  when :upload
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kdeploy
4
- VERSION = '1.1.1'
4
+ VERSION = '1.1.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kdeploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kk