kdeploy 1.0.5 → 1.0.6

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: 83c00c00789f233f007546ca34305f421da37baf99cdbae2f025335f1be06c19
4
- data.tar.gz: 6bf1d8e927c30f0e11d11aa14e1290ff8e7d224adb53a884fe621daf5776d7b1
3
+ metadata.gz: 0acb567d3c34e2937de6f0f4c455928ab071d9b0951499ba34c3dd10fc39b6dc
4
+ data.tar.gz: 96d62a683a09abcbce1b309294ccf8584ddb275fa4ed68f5ca09bb7efa1ee611
5
5
  SHA512:
6
- metadata.gz: 6827b3c353a608b1c554cb5ddd4c32909a938dd5125b9ab0175312b7a8b41b68830c578e11f6616ecb9fb884516a59eede85ecd8df321319334f49952d688761
7
- data.tar.gz: fe23ae3d9b659ae1124dad9b8c5804c07884bdd463315f96aac4a988a29f9c86035c6f73fc74ae40846fbb3e747d597f89af9d79751dbbf5b4e7446835ed24fd
6
+ metadata.gz: fdbc032e54d7915bc5d56d271ca54244d555f7d5b6200ee4b76dd9a6c6f060c5bc50408cd7e870cf2978f95901efd1ecd4805a2de3488df4fad95c6310b2bfdd
7
+ data.tar.gz: d629aaa50931b626de2fd11e8d4c4286f984dbff82a8f8e0fb8146ded23b5fbbb30536e031ec859a6558bcd75176198f55cb98a098c70b327bf3b9dd6b2d5cad
data/lib/kdeploy/cli.rb CHANGED
@@ -118,7 +118,8 @@ module Kdeploy
118
118
  exit 1
119
119
  end
120
120
 
121
- self.class.class_eval(File.read(file), file)
121
+ # 用 instance_eval 并传递顶层 binding,兼容 heredoc
122
+ self.class.module_eval(File.read(file), file)
122
123
  end
123
124
 
124
125
  def filter_hosts(limit, task_hosts)
@@ -24,12 +24,16 @@ module Kdeploy
24
24
  task[:block].call.each do |command|
25
25
  case command[:type]
26
26
  when :run
27
+ puts "[#{name}] $ #{command[:command].lines.first.strip}" # 实时输出主机和命令
28
+ command[:command].lines[1..].each { |line| puts "[#{name}] > #{line.strip}" unless line.strip.empty? }
27
29
  output = executor.execute(command[:command])
28
30
  result[:output] << { command: command[:command], output: output }
29
31
  when :upload
32
+ puts "[#{name}] upload: #{command[:source]} -> #{command[:destination]}"
30
33
  executor.upload(command[:source], command[:destination])
31
34
  result[:output] << { command: "upload: #{command[:source]} -> #{command[:destination]}" }
32
35
  when :upload_template
36
+ puts "[#{name}] upload_template: #{command[:source]} -> #{command[:destination]}"
33
37
  executor.upload_template(command[:source], command[:destination], command[:variables])
34
38
  result[:output] << { command: "upload_template: #{command[:source]} -> #{command[:destination]}" }
35
39
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kdeploy
4
- VERSION = '1.0.5'
4
+ VERSION = '1.0.6'
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.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kk