net-ssh-multi 1.2.1 → 1.3.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/.travis.yml +17 -0
- data/CHANGES.txt +5 -0
- data/README.rdoc +1 -1
- data/Rakefile +8 -2
- data/gem-public_cert.pem +18 -18
- data/lib/net/ssh/multi/pending_connection.rb +22 -0
- data/lib/net/ssh/multi/server.rb +1 -0
- data/lib/net/ssh/multi/session.rb +10 -1
- data/lib/net/ssh/multi/version.rb +7 -3
- data/net-ssh-multi.gemspec +9 -7
- data/test/session_test.rb +21 -0
- metadata +38 -54
- metadata.gz.sig +0 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: d7f1db872a17326b087503b4f113e23d7b61240c
|
4
|
+
data.tar.gz: 77b214deccd4705a1190f1aa6ed2c852733c6fb9
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 8eaad6d8cb066ee49066c0741350dcb39bab6935c66a61f90142e64d9d5de9d466040415715107fb92b7b2a03c65ca4d6295ad63dfb0d60b28a897a143c0a7db
|
7
|
+
data.tar.gz: 80fdc25e4cc1df9655777243a971a79d4bc963780c4d489ab453aae891f04d7e354834ad2cf28a40fb8f559cb0c0aa7a7dcc8adc74252b662967771fb42f72dc
|
checksums.yaml.gz.sig
ADDED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/.travis.yml
ADDED
data/CHANGES.txt
CHANGED
data/README.rdoc
CHANGED
@@ -66,7 +66,7 @@ If you want to run the tests or use any of the Rake tasks, you'll need:
|
|
66
66
|
|
67
67
|
* gem install net-ssh-multi
|
68
68
|
|
69
|
-
However, in order to be sure the code you're installing hasn't been tampered with, it's recommended that you verify the
|
69
|
+
However, in order to be sure the code you're installing hasn't been tampered with, it's recommended that you verify the signature[http://docs.rubygems.org/read/chapter/21]. To do this, you need to add my public key as a trusted certificate (you only need to do this once):
|
70
70
|
|
71
71
|
# Add the public key as a trusted certificate
|
72
72
|
# (You only need to do this once)
|
data/Rakefile
CHANGED
@@ -31,8 +31,14 @@ begin
|
|
31
31
|
|
32
32
|
s.license = "MIT"
|
33
33
|
|
34
|
-
|
35
|
-
|
34
|
+
unless ENV['NET_SSH_NOKEY']
|
35
|
+
signing_key = File.join('/mnt/gem/', 'net-ssh-private_key.pem')
|
36
|
+
s.signing_key = signing_key
|
37
|
+
s.cert_chain = ['gem-public_cert.pem']
|
38
|
+
unless (Rake.application.top_level_tasks & ['build','install']).empty?
|
39
|
+
raise "No key found at #{signing_key} for signing, use rake <taskname> NET_SSH_NOKEY=1 to build without key" unless File.exist?(signing_key)
|
40
|
+
end
|
41
|
+
end
|
36
42
|
end
|
37
43
|
Jeweler::GemcutterTasks.new
|
38
44
|
rescue LoadError
|
data/gem-public_cert.pem
CHANGED
@@ -1,20 +1,20 @@
|
|
1
1
|
-----BEGIN CERTIFICATE-----
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
2
|
+
MIIDODCCAiCgAwIBAgIBADANBgkqhkiG9w0BAQUFADBCMRAwDgYDVQQDDAduZXQt
|
3
|
+
c3NoMRkwFwYKCZImiZPyLGQBGRYJc29sdXRpb3VzMRMwEQYKCZImiZPyLGQBGRYD
|
4
|
+
Y29tMB4XDTE1MTIwNjIxMDYyNFoXDTE2MTIwNTIxMDYyNFowQjEQMA4GA1UEAwwH
|
5
|
+
bmV0LXNzaDEZMBcGCgmSJomT8ixkARkWCXNvbHV0aW91czETMBEGCgmSJomT8ixk
|
6
|
+
ARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMYnhNtn0f6p
|
7
|
+
nTylB8mE8lMdoMLJC8KwpMWsvk73Pe2WVDsH/OSwwwz6oUGk1i70cJyDjIEBNpwT
|
8
|
+
88GpVXJSumvqVsf9fCg3mWNeb5t0J+aeNm9MIvYVMTqj5tydoXQiwnILRDYHV9tZ
|
9
|
+
1c3o59/VlahSTpZ7YEgzVufpAkvEGkbJiG849exiipK7MN/ZIkMOxYVnyRXk43Xc
|
10
|
+
6GYlsHOfSgPwcXwW5g57DCwLQLWrjDsTka28dxDmO7B5Lv5EqzINxVxWsu43OgZG
|
11
|
+
21Io/jIyf5PNpeKPKNGDuAQJ8mvdMYBJoDhtCwgsUYbl0BZzA7g4ytl51HtIeP+j
|
12
|
+
Qp/eAvs/RrECAwEAAaM5MDcwCQYDVR0TBAIwADAdBgNVHQ4EFgQUBfKiwO2eM4NE
|
13
|
+
iRrVG793qEPLYyMwCwYDVR0PBAQDAgSwMA0GCSqGSIb3DQEBBQUAA4IBAQCfZFdb
|
14
|
+
p4jzkfIzGDbiOxd0R8sdqJoC4nMLEgnQ7dLulawwA3IXe3sHAKgA5kmH3prsKc5H
|
15
|
+
zVmM5NlH2P1nRbegIkQTYiIod1hZQCNxdmVG/fprMqPq0ybpUOjjrP5pj0OtszE1
|
16
|
+
F2dQia1hOEstMR+n0nAtWII9HJAEyeZjVV0s2Cl7Pt85XJ3hxFcCKwzqsK5xRI7a
|
17
|
+
B3vwh3/JJYrFonIohQ//Lg9qTZASEkoKLlq1/hFeICoCGGIGLq45ZB7CzXLooCKi
|
18
|
+
s/ZUKye79ELwFYKJOhjW5g725OL3hy+llhEleytwKRwgXFQBPTC4f5UkdxZVVWGH
|
19
|
+
e2C9M1m/2odPZo8h
|
20
20
|
-----END CERTIFICATE-----
|
@@ -31,6 +31,28 @@ module Net; module SSH; module Multi
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
+
# Represents a #forward action.
|
35
|
+
class ForwardRecording
|
36
|
+
def initialize
|
37
|
+
@recordings = []
|
38
|
+
end
|
39
|
+
|
40
|
+
def remote(port, host, remote_port, remote_host="127.0.0.1")
|
41
|
+
@recordings << [:remote, port, host, remote_port, remote_host]
|
42
|
+
end
|
43
|
+
|
44
|
+
def replay_on(session)
|
45
|
+
forward = session.forward
|
46
|
+
@recordings.each {|args| forward.send *args}
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def forward
|
51
|
+
forward = ForwardRecording.new
|
52
|
+
@recordings << forward
|
53
|
+
forward
|
54
|
+
end
|
55
|
+
|
34
56
|
# Represents a #send_global_request action.
|
35
57
|
class SendGlobalRequestRecording #:nodoc:
|
36
58
|
attr_reader :type, :extra, :callback
|
data/lib/net/ssh/multi/server.rb
CHANGED
@@ -425,7 +425,7 @@ module Net; module SSH; module Multi
|
|
425
425
|
# +false+ (the block returned +false+).
|
426
426
|
def process(wait=nil, &block)
|
427
427
|
realize_pending_connections!
|
428
|
-
wait = @connect_threads.any? ? 0 : wait
|
428
|
+
wait = @connect_threads.any? ? 0 : io_select_wait(wait)
|
429
429
|
|
430
430
|
return false unless preprocess(&block)
|
431
431
|
|
@@ -441,6 +441,15 @@ module Net; module SSH; module Multi
|
|
441
441
|
end
|
442
442
|
end
|
443
443
|
|
444
|
+
def io_select_wait(wait)
|
445
|
+
[wait, keepalive_interval].compact.min
|
446
|
+
end
|
447
|
+
|
448
|
+
def keepalive_interval
|
449
|
+
servers = server_list.select { |s| s.options[:keepalive] }
|
450
|
+
servers.map { |s| s.options[:keepalive_interval] }.compact.min
|
451
|
+
end
|
452
|
+
|
444
453
|
# Runs the preprocess stage on all servers. Returns false if the block
|
445
454
|
# returns false, and true if there either is no block, or it returns true.
|
446
455
|
# This is called as part of the #process method.
|
@@ -7,13 +7,17 @@ module Net; module SSH; module Multi
|
|
7
7
|
MAJOR = 1
|
8
8
|
|
9
9
|
# The minor component of the library's version
|
10
|
-
MINOR =
|
10
|
+
MINOR = 3
|
11
11
|
|
12
12
|
# The tiny component of the library's version
|
13
|
-
TINY =
|
13
|
+
TINY = 0
|
14
|
+
|
15
|
+
# The prerelease component of this version of the Net::SSH library
|
16
|
+
# nil allowed
|
17
|
+
PRE = "rc1"
|
14
18
|
|
15
19
|
# The library's version as a Version instance
|
16
|
-
CURRENT = new(MAJOR, MINOR, TINY)
|
20
|
+
CURRENT = new(*[MAJOR, MINOR, TINY, PRE].compact)
|
17
21
|
|
18
22
|
# The library's version as a String instance
|
19
23
|
STRING = CURRENT.to_s
|
data/net-ssh-multi.gemspec
CHANGED
@@ -2,15 +2,17 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
+
# stub: net-ssh-multi 1.3.0.rc1 ruby lib
|
5
6
|
|
6
7
|
Gem::Specification.new do |s|
|
7
8
|
s.name = "net-ssh-multi"
|
8
|
-
s.version = "1.
|
9
|
+
s.version = "1.3.0.rc1"
|
9
10
|
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new("
|
11
|
+
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
12
|
+
s.require_paths = ["lib"]
|
11
13
|
s.authors = ["Jamis Buck", "Delano Mandelbaum"]
|
12
14
|
s.cert_chain = ["gem-public_cert.pem"]
|
13
|
-
s.date = "
|
15
|
+
s.date = "2016-03-24"
|
14
16
|
s.description = "Control multiple Net::SSH connections via a single interface."
|
15
17
|
s.email = "net-ssh@solutious.com"
|
16
18
|
s.extra_rdoc_files = [
|
@@ -18,6 +20,7 @@ Gem::Specification.new do |s|
|
|
18
20
|
"README.rdoc"
|
19
21
|
]
|
20
22
|
s.files = [
|
23
|
+
".travis.yml",
|
21
24
|
"CHANGES.txt",
|
22
25
|
"LICENSE.txt",
|
23
26
|
"README.rdoc",
|
@@ -45,14 +48,13 @@ Gem::Specification.new do |s|
|
|
45
48
|
]
|
46
49
|
s.homepage = "https://github.com/net-ssh/net-scp"
|
47
50
|
s.licenses = ["MIT"]
|
48
|
-
s.require_paths = ["lib"]
|
49
51
|
s.rubyforge_project = "net-ssh-multi"
|
50
|
-
s.rubygems_version = "
|
51
|
-
s.signing_key = "/mnt/gem/
|
52
|
+
s.rubygems_version = "2.4.6"
|
53
|
+
s.signing_key = "/mnt/gem/net-ssh-private_key.pem"
|
52
54
|
s.summary = "Control multiple Net::SSH connections via a single interface."
|
53
55
|
|
54
56
|
if s.respond_to? :specification_version then
|
55
|
-
s.specification_version =
|
57
|
+
s.specification_version = 4
|
56
58
|
|
57
59
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
58
60
|
s.add_runtime_dependency(%q<net-ssh>, [">= 2.6.5"])
|
data/test/session_test.rb
CHANGED
@@ -198,4 +198,25 @@ class SessionTest < Minitest::Test
|
|
198
198
|
IO.expects(:select).with([:a, :b, :c], [:a, :c], nil, 5).returns([[:b, :c], [:a, :c]])
|
199
199
|
@session.process(5)
|
200
200
|
end
|
201
|
+
|
202
|
+
def test_process_should_pass_minimum_keepalive_interval_as_io_select_timeout
|
203
|
+
@session.use('h1', :keepalive => true)
|
204
|
+
@session.use('h2', :keepalive_interval => 1)
|
205
|
+
@session.use('h3', :keepalive => true, :keepalive_interval => 2)
|
206
|
+
@session.use('h4', :keepalive => true, :keepalive_interval => 3)
|
207
|
+
IO.expects(:select).with([], [], nil, 2)
|
208
|
+
@session.process
|
209
|
+
end
|
210
|
+
|
211
|
+
def test_process_should_pass_wait_as_io_select_timeout_if_provided_and_minimum
|
212
|
+
@session.use('h1', :keepalive => true, :keepalive_interval => 1)
|
213
|
+
IO.expects(:select).with([], [], nil, 1)
|
214
|
+
@session.process(2)
|
215
|
+
end
|
216
|
+
|
217
|
+
def test_process_should_pass_nil_as_io_select_timeout_by_default
|
218
|
+
@session.use('h1')
|
219
|
+
IO.expects(:select).with([], [], nil, nil)
|
220
|
+
@session.process
|
221
|
+
end
|
201
222
|
end
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: net-ssh-multi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
5
|
-
prerelease:
|
4
|
+
version: 1.3.0.rc1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Jamis Buck
|
@@ -10,98 +9,83 @@ authors:
|
|
10
9
|
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain:
|
13
|
-
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
NW1pYkVsR1ZsT29iZi9naHFaMjVIUzlKNmtkMC9DL3J5MEFVdFRvZ3NMN1R4
|
36
|
-
R3dUNGtiQ3g2M3ViCjN2eXdFRWhzSlV6ZmQ5N0dDQUJtdFFmUlRsZFgvajdG
|
37
|
-
MXovNXdkOHAraGZkb3gxaWliZHM5WnRmYVpBM0t6S24Ka2NoV045QjZ6Zzly
|
38
|
-
MVhNUThCTTJKejBYb1BhblBlMzU0K2xXd2pwa1JLYkZvdy9aYlFIY0NMQ3Ey
|
39
|
-
NCtONmI2ZwpkZ0tmTkR6d2lEcHFDQT09Ci0tLS0tRU5EIENFUlRJRklDQVRF
|
40
|
-
LS0tLS0K
|
41
|
-
date: 2015-04-11 00:00:00.000000000 Z
|
12
|
+
- |
|
13
|
+
-----BEGIN CERTIFICATE-----
|
14
|
+
MIIDODCCAiCgAwIBAgIBADANBgkqhkiG9w0BAQUFADBCMRAwDgYDVQQDDAduZXQt
|
15
|
+
c3NoMRkwFwYKCZImiZPyLGQBGRYJc29sdXRpb3VzMRMwEQYKCZImiZPyLGQBGRYD
|
16
|
+
Y29tMB4XDTE1MTIwNjIxMDYyNFoXDTE2MTIwNTIxMDYyNFowQjEQMA4GA1UEAwwH
|
17
|
+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date: 2016-03-24 00:00:00.000000000 Z
|
42
34
|
dependencies:
|
43
35
|
- !ruby/object:Gem::Dependency
|
44
36
|
name: net-ssh
|
45
37
|
requirement: !ruby/object:Gem::Requirement
|
46
|
-
none: false
|
47
38
|
requirements:
|
48
|
-
- -
|
39
|
+
- - ">="
|
49
40
|
- !ruby/object:Gem::Version
|
50
41
|
version: 2.6.5
|
51
42
|
type: :runtime
|
52
43
|
prerelease: false
|
53
44
|
version_requirements: !ruby/object:Gem::Requirement
|
54
|
-
none: false
|
55
45
|
requirements:
|
56
|
-
- -
|
46
|
+
- - ">="
|
57
47
|
- !ruby/object:Gem::Version
|
58
48
|
version: 2.6.5
|
59
49
|
- !ruby/object:Gem::Dependency
|
60
50
|
name: net-ssh-gateway
|
61
51
|
requirement: !ruby/object:Gem::Requirement
|
62
|
-
none: false
|
63
52
|
requirements:
|
64
|
-
- -
|
53
|
+
- - ">="
|
65
54
|
- !ruby/object:Gem::Version
|
66
55
|
version: 1.2.0
|
67
56
|
type: :runtime
|
68
57
|
prerelease: false
|
69
58
|
version_requirements: !ruby/object:Gem::Requirement
|
70
|
-
none: false
|
71
59
|
requirements:
|
72
|
-
- -
|
60
|
+
- - ">="
|
73
61
|
- !ruby/object:Gem::Version
|
74
62
|
version: 1.2.0
|
75
63
|
- !ruby/object:Gem::Dependency
|
76
64
|
name: minitest
|
77
65
|
requirement: !ruby/object:Gem::Requirement
|
78
|
-
none: false
|
79
66
|
requirements:
|
80
|
-
- -
|
67
|
+
- - ">="
|
81
68
|
- !ruby/object:Gem::Version
|
82
69
|
version: '0'
|
83
70
|
type: :development
|
84
71
|
prerelease: false
|
85
72
|
version_requirements: !ruby/object:Gem::Requirement
|
86
|
-
none: false
|
87
73
|
requirements:
|
88
|
-
- -
|
74
|
+
- - ">="
|
89
75
|
- !ruby/object:Gem::Version
|
90
76
|
version: '0'
|
91
77
|
- !ruby/object:Gem::Dependency
|
92
78
|
name: mocha
|
93
79
|
requirement: !ruby/object:Gem::Requirement
|
94
|
-
none: false
|
95
80
|
requirements:
|
96
|
-
- -
|
81
|
+
- - ">="
|
97
82
|
- !ruby/object:Gem::Version
|
98
83
|
version: '0'
|
99
84
|
type: :development
|
100
85
|
prerelease: false
|
101
86
|
version_requirements: !ruby/object:Gem::Requirement
|
102
|
-
none: false
|
103
87
|
requirements:
|
104
|
-
- -
|
88
|
+
- - ">="
|
105
89
|
- !ruby/object:Gem::Version
|
106
90
|
version: '0'
|
107
91
|
description: Control multiple Net::SSH connections via a single interface.
|
@@ -112,6 +96,7 @@ extra_rdoc_files:
|
|
112
96
|
- LICENSE.txt
|
113
97
|
- README.rdoc
|
114
98
|
files:
|
99
|
+
- ".travis.yml"
|
115
100
|
- CHANGES.txt
|
116
101
|
- LICENSE.txt
|
117
102
|
- README.rdoc
|
@@ -139,26 +124,25 @@ files:
|
|
139
124
|
homepage: https://github.com/net-ssh/net-scp
|
140
125
|
licenses:
|
141
126
|
- MIT
|
127
|
+
metadata: {}
|
142
128
|
post_install_message:
|
143
129
|
rdoc_options: []
|
144
130
|
require_paths:
|
145
131
|
- lib
|
146
132
|
required_ruby_version: !ruby/object:Gem::Requirement
|
147
|
-
none: false
|
148
133
|
requirements:
|
149
|
-
- -
|
134
|
+
- - ">="
|
150
135
|
- !ruby/object:Gem::Version
|
151
136
|
version: '0'
|
152
137
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
153
|
-
none: false
|
154
138
|
requirements:
|
155
|
-
- -
|
139
|
+
- - ">"
|
156
140
|
- !ruby/object:Gem::Version
|
157
|
-
version:
|
141
|
+
version: 1.3.1
|
158
142
|
requirements: []
|
159
143
|
rubyforge_project: net-ssh-multi
|
160
|
-
rubygems_version:
|
144
|
+
rubygems_version: 2.4.6
|
161
145
|
signing_key:
|
162
|
-
specification_version:
|
146
|
+
specification_version: 4
|
163
147
|
summary: Control multiple Net::SSH connections via a single interface.
|
164
148
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|