sshkit 1.15.0 → 1.15.1

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
- SHA1:
3
- metadata.gz: 45f49f25df22edea1abf8c5db3edda63255ddbb2
4
- data.tar.gz: 71642fd8de408f19d9e40fad80ce7315ca553235
2
+ SHA256:
3
+ metadata.gz: f014bf146a912a66d7378d4ed9361ad19afabead2046d5ca35b9b44f9956a7e6
4
+ data.tar.gz: c7a83d9d9ac1cac5c598db99713a0d6bb1059922ebbe31f76aa9c960bb1b202c
5
5
  SHA512:
6
- metadata.gz: 2483400c0e519f6ea60432371a04d77c523a965db7cf117c611056aa052f87125ccb605ec1ae241bec4f24ec1e75f03ef2927dce8d0a64757147a4fe0ce8e4f0
7
- data.tar.gz: 360df78c26c2e413e54d02f0152279f968f25ad3373e3f0fd36086d6bc867f1aa473937e84e7be0602047307042c45426d35833e8c0c5be803da243d95ced76b
6
+ metadata.gz: 8beca7b0370fddca01b404215d324e43222602847ee11080806e047a19967874a94838fc7913e630f473df0b9a4c115649adc1daae43bf02ff996a8959244b8e
7
+ data.tar.gz: 40d829a5730abfd31ad8d06ed890a92063f30661ea6d48d05e8303f2cfef881eef0656cf464e51555cc2c0199c48866485621bec65ecddbd22433851078ac745
data/CHANGELOG.md CHANGED
@@ -7,6 +7,19 @@ appear at the top.
7
7
 
8
8
  * Your contribution here!
9
9
 
10
+ ## [1.15.1][] (2017-11-18)
11
+
12
+ This is a small bug-fix release that fixes problems with `upload!` and `download!` that were inadvertently introduced in 1.15.0.
13
+
14
+ ### Breaking changes
15
+
16
+ * None
17
+
18
+ ### Bug fixes
19
+
20
+ * [#410](https://github.com/capistrano/sshkit/pull/410): fix NoMethodError when using upload!/download! with Pathnames - [@UnderpantsGnome](https://github.com/UnderpantsGnome)
21
+ * [#411](https://github.com/capistrano/sshkit/pull/410): fix upload!/download! when using relative paths outside of `within` blocks - [@Fjan](https://github.com/Fjan)
22
+
10
23
  ## [1.15.0][] (2017-11-03)
11
24
 
12
25
  ### New features
@@ -721,7 +734,8 @@ version `0.0.5`.
721
734
 
722
735
  First release.
723
736
 
724
- [Unreleased]: https://github.com/capistrano/sshkit/compare/v1.15.0...HEAD
737
+ [Unreleased]: https://github.com/capistrano/sshkit/compare/v1.15.1...HEAD
738
+ [1.15.1]: https://github.com/capistrano/sshkit/compare/v1.15.0...v1.15.1
725
739
  [1.15.0]: https://github.com/capistrano/sshkit/compare/v1.14.0...v1.15.0
726
740
  [1.14.0]: https://github.com/capistrano/sshkit/compare/v1.13.1...v1.14.0
727
741
  [1.13.1]: https://github.com/capistrano/sshkit/compare/v1.13.0...v1.13.1
@@ -11,7 +11,7 @@ module SSHKit
11
11
  end
12
12
 
13
13
  def upload!(local, remote, options = {})
14
- remote = File.join(pwd_path, remote) unless remote.start_with?("/")
14
+ remote = File.join(pwd_path, remote) unless remote.to_s.start_with?("/") || pwd_path.nil?
15
15
  if local.is_a?(String)
16
16
  if options[:recursive]
17
17
  FileUtils.cp_r(local, remote)
@@ -26,7 +26,7 @@ module SSHKit
26
26
  end
27
27
 
28
28
  def download!(remote, local=nil, _options = {})
29
- remote = File.join(pwd_path, remote) unless remote.start_with?("/")
29
+ remote = File.join(pwd_path, remote) unless remote.to_s.start_with?("/") || pwd_path.nil?
30
30
  if local.nil?
31
31
  FileUtils.cp(remote, File.basename(remote))
32
32
  else
@@ -63,7 +63,7 @@ module SSHKit
63
63
 
64
64
  def upload!(local, remote, options = {})
65
65
  summarizer = transfer_summarizer('Uploading', options)
66
- remote = File.join(pwd_path, remote) unless remote.start_with?("/")
66
+ remote = File.join(pwd_path, remote) unless remote.to_s.start_with?("/") || pwd_path.nil?
67
67
  with_ssh do |ssh|
68
68
  ssh.scp.upload!(local, remote, options, &summarizer)
69
69
  end
@@ -71,7 +71,7 @@ module SSHKit
71
71
 
72
72
  def download!(remote, local=nil, options = {})
73
73
  summarizer = transfer_summarizer('Downloading', options)
74
- remote = File.join(pwd_path, remote) unless remote.start_with?("/")
74
+ remote = File.join(pwd_path, remote) unless remote.to_s.start_with?("/") || pwd_path.nil?
75
75
  with_ssh do |ssh|
76
76
  ssh.scp.download!(remote, local, options, &summarizer)
77
77
  end
@@ -1,3 +1,3 @@
1
1
  module SSHKit
2
- VERSION = "1.15.0".freeze
2
+ VERSION = "1.15.1".freeze
3
3
  end
@@ -20,6 +20,16 @@ module SSHKit
20
20
  end
21
21
  end
22
22
 
23
+ def test_upload_via_pathname
24
+ Dir.mktmpdir do |dir|
25
+ File.new("#{dir}/local", 'w')
26
+ Local.new do
27
+ upload!("#{dir}/local", Pathname.new("#{dir}/remote"))
28
+ end.run
29
+ assert File.exist?("#{dir}/remote")
30
+ end
31
+ end
32
+
23
33
  def test_upload_within
24
34
  file_contents = "Some Content"
25
35
  actual_file_contents = nil
@@ -145,6 +145,16 @@ module SSHKit
145
145
  assert_equal File.open(file_name).read, file_contents
146
146
  end
147
147
 
148
+ def test_upload_via_pathname
149
+ file_contents = ""
150
+ Netssh.new(a_host) do |_host|
151
+ file_name = Pathname.new(File.join("/tmp", SecureRandom.uuid))
152
+ upload!(StringIO.new('example_io'), file_name)
153
+ file_contents = download!(file_name)
154
+ end.run
155
+ assert_equal "example_io", file_contents
156
+ end
157
+
148
158
  def test_interaction_handler
149
159
  captured_command_result = nil
150
160
  Netssh.new(a_host) do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sshkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.15.0
4
+ version: 1.15.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lee Hambley
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-11-03 00:00:00.000000000 Z
12
+ date: 2017-11-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: net-ssh
@@ -293,7 +293,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
293
293
  version: '0'
294
294
  requirements: []
295
295
  rubyforge_project:
296
- rubygems_version: 2.6.14
296
+ rubygems_version: 2.7.2
297
297
  signing_key:
298
298
  specification_version: 4
299
299
  summary: SSHKit makes it easy to write structured, testable SSH commands in Ruby