net-ssh 3.0.0.rc1 → 3.0.1.rc1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 35b946a2c8c50c7f415772cd795bfb22b32a580a
4
- data.tar.gz: 88229af4861f293ed5e20209f60cc65d879cb2d6
3
+ metadata.gz: 3d164d026393607b9458300322c53263a7ec5177
4
+ data.tar.gz: 3e413fdc16491481a5409b5f9d372d40c5092382
5
5
  SHA512:
6
- metadata.gz: 73111c96b59044bc841bcd2e16adaaabb6b0778a25754ddf461eec4bcd3fd26bc57ed3ed19bcf29f6978cb88022eaf9098774891a60f2c5f2234d20372ddf0d5
7
- data.tar.gz: 4f62ed4e65be39045f14f8f53608e03f977a674deeb13bcf2ce5a0fe81777dfe90f1f5d31d6b62eb22af38cf06d977708dc0d03ef38232915ac4a0514333de82
6
+ metadata.gz: 3f502d0b2b3b64c5b99a36ebc05c0b8c4e894264809f10fd60ee46ac30254ef26332fde43ba48975c997f74fb2401f028e301cb9ff6f3fbfe0285a3583d403ca
7
+ data.tar.gz: 3542a91dfa1c82d56c3f4364582733f3ffe571eb46ef56599b78e677a8fc06e865ab27ca825892b52d8bf39d4f6d53fbc1c8fa2399cd2728da5a4b95506263a3
Binary file
data.tar.gz.sig CHANGED
@@ -1,2 +1,2 @@
1
- q5�*W�R[�-9��V�����2sbC�G�ג��
2
- vrgz�]�����^������icx���$�����Z4��@�;="������a\��&8gާ�wHx
1
+ u���8
2
+ +d���frND�Eb[tE��z"�F�q/�Vt!y)�e��;/JC�yv�{β�K�2%�i���ᑓ�y�߫2i3[,��wE
@@ -1,3 +1,9 @@
1
+ === 3.0.1.rc1
2
+
3
+ * Breaking change from 2.* series: exec! without block now returns empty string instread of nil if command has no output [https://github.com/net-ssh/net-ssh/pull/273]
4
+ * Support remote_user as %r in proxy commands [Dominic Scheirlinck]
5
+ * Raise Net::SSH::ConnectionTimeout from connection timeout [Carl Hoerberg]
6
+
1
7
  === 3.0.0.rc1
2
8
 
3
9
  * SemVer: Major version change because of dropping of ruby 1.9
@@ -62,7 +62,7 @@ module Net
62
62
  # Net::SSH.start for a description of each option.
63
63
  VALID_OPTIONS = [
64
64
  :auth_methods, :bind_address, :compression, :compression_level, :config,
65
- :encryption, :forward_agent, :hmac, :host_key,
65
+ :encryption, :forward_agent, :hmac, :host_key, :remote_user,
66
66
  :keepalive, :keepalive_interval, :keepalive_maxcount, :kex, :keys, :key_data,
67
67
  :languages, :logger, :paranoid, :password, :port, :proxy,
68
68
  :rekey_blocks_limit,:rekey_limit, :rekey_packet_limit, :timeout, :verbose,
@@ -169,6 +169,7 @@ module Net
169
169
  # * :user => the user name to log in as; this overrides the +user+
170
170
  # parameter, and is primarily only useful when provided via an SSH
171
171
  # configuration file.
172
+ # * :remote_user => used for substitution into the '%r' part of a ProxyCommand
172
173
  # * :user_known_hosts_file => the location of the user known hosts file.
173
174
  # Set to an array to specify multiple user known hosts files.
174
175
  # Defaults to %w(~/.ssh/known_hosts ~/.ssh/known_hosts2).
@@ -351,19 +351,21 @@ module Net; module SSH; module Connection
351
351
  end
352
352
 
353
353
  # Same as #exec, except this will block until the command finishes. Also,
354
- # if a block is not given, this will return all output (stdout and stderr)
354
+ # if no block is given, this will return all output (stdout and stderr)
355
355
  # as a single string.
356
356
  #
357
357
  # matches = ssh.exec!("grep something /some/files")
358
358
  def exec!(command, &block)
359
- block ||= Proc.new do |ch, type, data|
359
+ block_or_concat = block || Proc.new do |ch, type, data|
360
360
  ch[:result] ||= ""
361
361
  ch[:result] << data
362
362
  end
363
363
 
364
- channel = exec(command, &block)
364
+ channel = exec(command, &block_or_concat)
365
365
  channel.wait
366
366
 
367
+ channel[:result] ||= "" unless block
368
+
367
369
  return channel[:result]
368
370
  end
369
371
 
@@ -85,6 +85,8 @@ module Net; module SSH; module Transport
85
85
 
86
86
  @algorithms = Algorithms.new(self, options)
87
87
  wait { algorithms.initialized? }
88
+ rescue Errno::ETIMEDOUT
89
+ raise Net::SSH::ConnectionTimeout
88
90
  end
89
91
 
90
92
  # Returns the host (and possibly IP address) in a format compatible with
@@ -51,7 +51,7 @@ module Net; module SSH
51
51
  MINOR = 0
52
52
 
53
53
  # The tiny component of this version of the Net::SSH library
54
- TINY = 0
54
+ TINY = 1
55
55
 
56
56
  # The prerelease component of this version of the Net::SSH library
57
57
  # nil allowed
@@ -2,17 +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 3.0.0.rc1 ruby lib
5
+ # stub: net-ssh 3.0.1.rc1 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "net-ssh"
9
- s.version = "3.0.0.rc1"
9
+ s.version = "3.0.1.rc1"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Jamis Buck", "Delano Mandelbaum", "Mikl\u{f3}s Fazekas"]
14
14
  s.cert_chain = ["net-ssh-public_cert.pem"]
15
- s.date = "2015-09-14"
15
+ s.date = "2015-09-19"
16
16
  s.description = "Net::SSH: a pure-Ruby implementation of the SSH2 client protocol. It allows you to write programs that invoke and interact with processes on remote servers, via SSH2."
17
17
  s.email = "net-ssh@solutious.com"
18
18
  s.extra_rdoc_files = [
@@ -134,6 +134,7 @@ Gem::Specification.new do |s|
134
134
  "test/configs/negative_match",
135
135
  "test/configs/nohost",
136
136
  "test/configs/numeric_host",
137
+ "test/configs/proxy_remote_user",
137
138
  "test/configs/send_env",
138
139
  "test/configs/substitutes",
139
140
  "test/configs/wild_cards",
@@ -0,0 +1,2 @@
1
+ Host behind-proxy
2
+ ProxyCommand ssh %r@proxy -W %h:%p
@@ -473,6 +473,11 @@ module Connection
473
473
  assert_equal "some data", session.exec!("ls")
474
474
  end
475
475
 
476
+ def test_exec_bang_without_block_should_return_empty_string_for_empty_command_output
477
+ prep_exec('ls', :stdout, '')
478
+ assert_equal "", session.exec!('ls')
479
+ end
480
+
476
481
  private
477
482
 
478
483
  def prep_exec(command, *data)
@@ -488,10 +493,8 @@ module Connection
488
493
 
489
494
  t2.return(CHANNEL_SUCCESS, :long, p[:remote_id])
490
495
 
491
- 0.step(data.length-1, 2) do |index|
492
- type = data[index]
493
- datum = data[index+1]
494
-
496
+ data.each_slice(2) do |type, datum|
497
+ next if datum.empty?
495
498
  if type == :stdout
496
499
  t2.return(CHANNEL_DATA, :long, p[:remote_id], :string, datum)
497
500
  else
@@ -45,6 +45,13 @@ module NetSSH
45
45
  Net::SSH.start('localhost', 'testuser', options)
46
46
  end
47
47
  end
48
+
49
+ def test_start_should_accept_remote_user_option
50
+ assert_nothing_raised do
51
+ options = { :remote_user => 'foo' }
52
+ Net::SSH.start('localhost', 'testuser', options)
53
+ end
54
+ end
48
55
  end
49
56
  end
50
57
 
@@ -213,6 +213,12 @@ class TestConfig < Test::Unit::TestCase
213
213
  assert_equal [/^GIT_.*$/, /^LANG$/, /^LC_.*$/], net_ssh[:send_env]
214
214
  end
215
215
 
216
+ def test_load_with_remote_user
217
+ config = Net::SSH::Config.load(config(:proxy_remote_user), "behind-proxy")
218
+ net_ssh = Net::SSH::Config.translate(config)
219
+ assert net_ssh[:proxy]
220
+ end
221
+
216
222
  private
217
223
 
218
224
  def config(name)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: net-ssh
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.rc1
4
+ version: 3.0.1.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jamis Buck
@@ -31,7 +31,7 @@ cert_chain:
31
31
  MbvRpzgROzyfw1qYi4dnIyMwTtXFFcZ0a2jpxHPkcTYFK6TzvFgDLAP0Y/u9jqUQ
32
32
  eZ7/3CdSi/isZHEw
33
33
  -----END CERTIFICATE-----
34
- date: 2015-09-14 00:00:00.000000000 Z
34
+ date: 2015-09-19 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: test-unit
@@ -185,6 +185,7 @@ files:
185
185
  - test/configs/negative_match
186
186
  - test/configs/nohost
187
187
  - test/configs/numeric_host
188
+ - test/configs/proxy_remote_user
188
189
  - test/configs/send_env
189
190
  - test/configs/substitutes
190
191
  - test/configs/wild_cards
metadata.gz.sig CHANGED
Binary file