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 +5 -5
- data/CHANGELOG.md +15 -1
- data/lib/sshkit/backends/local.rb +2 -2
- data/lib/sshkit/backends/netssh.rb +2 -2
- data/lib/sshkit/version.rb +1 -1
- data/test/functional/backends/test_local.rb +10 -0
- data/test/functional/backends/test_netssh.rb +10 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f014bf146a912a66d7378d4ed9361ad19afabead2046d5ca35b9b44f9956a7e6
|
4
|
+
data.tar.gz: c7a83d9d9ac1cac5c598db99713a0d6bb1059922ebbe31f76aa9c960bb1b202c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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
|
data/lib/sshkit/version.rb
CHANGED
@@ -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.
|
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-
|
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.
|
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
|