kdeploy 1.0.4 → 1.0.5

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: '03944aa593bff10b74d9e759c5228c3d67ee1d755581634621fe177c603067be'
4
- data.tar.gz: 4217dec1ce5d68aafc9bddafd0bb73d7033c30453c9479642c116dff2bc035d7
3
+ metadata.gz: 83c00c00789f233f007546ca34305f421da37baf99cdbae2f025335f1be06c19
4
+ data.tar.gz: 6bf1d8e927c30f0e11d11aa14e1290ff8e7d224adb53a884fe621daf5776d7b1
5
5
  SHA512:
6
- metadata.gz: 519644cfb036c05fb4939f0c104fdf73dde83b51de13856a7d6d1d1b42590e03bc9114b2736217187fa91e2582a78a28d68bc1b2bb82034cf74773ea64a1eda4
7
- data.tar.gz: e6f0f513e91dd14f85a8b859ef47015cb6710a8cb9b00ba07e971b8c59453c1d0e51584cc94a89d2290ce147a5f42fe38413a221dc82cb273e6a2ff8afc363fb
6
+ metadata.gz: 6827b3c353a608b1c554cb5ddd4c32909a938dd5125b9ab0175312b7a8b41b68830c578e11f6616ecb9fb884516a59eede85ecd8df321319334f49952d688761
7
+ data.tar.gz: fe23ae3d9b659ae1124dad9b8c5804c07884bdd463315f96aac4a988a29f9c86035c6f73fc74ae40846fbb3e747d597f89af9d79751dbbf5b4e7446835ed24fd
@@ -19,15 +19,22 @@ module Kdeploy
19
19
  stdout = String.new
20
20
  stderr = String.new
21
21
 
22
- ssh.exec!(command) do |_channel, stream, data|
23
- case stream
24
- when :stdout
25
- stdout << data
26
- when :stderr
27
- stderr << data
22
+ ssh.open_channel do |channel|
23
+ channel.exec(command) do |_ch, success|
24
+ raise "Could not execute command: #{command}" unless success
25
+
26
+ channel.on_data do |_ch, data|
27
+ print data # 实时输出
28
+ stdout << data
29
+ end
30
+
31
+ channel.on_extended_data do |_ch, _type, data|
32
+ print data # 实时输出
33
+ stderr << data
34
+ end
28
35
  end
29
36
  end
30
-
37
+ ssh.loop
31
38
  {
32
39
  stdout: stdout.strip,
33
40
  stderr: stderr.strip,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kdeploy
4
- VERSION = '1.0.4'
4
+ VERSION = '1.0.5'
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.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kk