kdeploy 1.0.3 → 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: 0ae0aae915ce13a7baf32218819dd5dae722477d70ec9a3d6c51f1fdf6758f81
4
- data.tar.gz: 258b0f8e7f74bfacac534cef9add8cc9c48b809f7cab81b35ddbc38b9658606b
3
+ metadata.gz: 83c00c00789f233f007546ca34305f421da37baf99cdbae2f025335f1be06c19
4
+ data.tar.gz: 6bf1d8e927c30f0e11d11aa14e1290ff8e7d224adb53a884fe621daf5776d7b1
5
5
  SHA512:
6
- metadata.gz: 2430cd40535b7b35973acca3046e56a9c74626b299c94f7d56bc4cda3b41ca95fb62a0cf582cc7a0bce6dd4ecae921258f6b065a73b55e91390a9a7c7c47a952
7
- data.tar.gz: 181af2943ea7bb12f569ef4884e270bfbc414aed51a508e77c13e98d4a45df24dd63e853ad14ceeb1e3a7f27d54707bda630906729233dcf577fa4e356e99b92
6
+ metadata.gz: 6827b3c353a608b1c554cb5ddd4c32909a938dd5125b9ab0175312b7a8b41b68830c578e11f6616ecb9fb884516a59eede85ecd8df321319334f49952d688761
7
+ data.tar.gz: fe23ae3d9b659ae1124dad9b8c5804c07884bdd463315f96aac4a988a29f9c86035c6f73fc74ae40846fbb3e747d597f89af9d79751dbbf5b4e7446835ed24fd
data/README.md CHANGED
@@ -108,6 +108,11 @@ end
108
108
  ```bash
109
109
  kdeploy execute deploy.rb
110
110
  ```
111
+ 4. demo:
112
+
113
+ ```bash
114
+ https://github.com/kevin197011/kdeploy-app
115
+ ```
111
116
 
112
117
  ## 📖 Usage Guide
113
118
 
@@ -244,4 +249,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
244
249
 
245
250
  ## 🔍 Code of Conduct
246
251
 
247
- Everyone interacting in the Kdeploy project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/kdeploy/blob/main/CODE_OF_CONDUCT.md).
252
+ Everyone interacting in the Kdeploy project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/kdeploy/blob/main/CODE_OF_CONDUCT.md).
@@ -11,6 +11,7 @@ module Kdeploy
11
11
  @ip = host_config[:ip]
12
12
  @password = host_config[:password]
13
13
  @key = host_config[:key]
14
+ @port = host_config[:port] # 新增端口支持
14
15
  end
15
16
 
16
17
  def execute(command)
@@ -18,15 +19,22 @@ module Kdeploy
18
19
  stdout = String.new
19
20
  stderr = String.new
20
21
 
21
- ssh.exec!(command) do |_channel, stream, data|
22
- case stream
23
- when :stdout
24
- stdout << data
25
- when :stderr
26
- 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
27
35
  end
28
36
  end
29
-
37
+ ssh.loop
30
38
  {
31
39
  stdout: stdout.strip,
32
40
  stderr: stderr.strip,
@@ -66,7 +74,7 @@ module Kdeploy
66
74
  elsif @key
67
75
  options[:keys] = [@key]
68
76
  end
69
-
77
+ options[:port] = @port if @port # 新增端口传递
70
78
  options
71
79
  end
72
80
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kdeploy
4
- VERSION = '1.0.3'
4
+ VERSION = '1.0.5'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kdeploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
- - Norton
7
+ - Kk
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-07-01 00:00:00.000000000 Z
11
+ date: 2025-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby