sshkit 0.0.24 → 0.0.25
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.
- data/CHANGELOG.md +9 -0
- data/lib/sshkit/backends/netssh.rb +12 -2
- data/lib/sshkit/version.rb +1 -1
- metadata +1 -1
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,15 @@
|
|
3
3
|
This file is written in reverse chronological order, newer releases will
|
4
4
|
appear at the top.
|
5
5
|
|
6
|
+
## 0.0.25
|
7
|
+
|
8
|
+
* `upload!` and `download!` now log to different levels depending on
|
9
|
+
completion percentage. When the upload is 0 percent complete or a number
|
10
|
+
indivisible by 10, the message is logged to `Logger::DEBUG` otherwise the
|
11
|
+
message is logged to `Logger::INFO`, this should mean that normal users at
|
12
|
+
a sane log level should see upload progress jump to `100%` for small
|
13
|
+
files, and otherwise for larger files they'll see output every `10%`.
|
14
|
+
|
6
15
|
## 0.0.24
|
7
16
|
|
8
17
|
* Pretty output now streams stdout and stderr. Previous versions would
|
@@ -40,13 +40,23 @@ module SSHKit
|
|
40
40
|
|
41
41
|
def upload!(local, remote, options = {})
|
42
42
|
ssh.scp.upload!(local, remote, options) do |ch, name, sent, total|
|
43
|
-
|
43
|
+
percentage = (sent.to_f * 100 / total.to_f).to_i
|
44
|
+
if percentage > 0 && percentage % 10 == 0
|
45
|
+
info "Uploading #{name} #{percentage}%"
|
46
|
+
else
|
47
|
+
debug "Uploading #{name} #{percentage}%"
|
48
|
+
end
|
44
49
|
end
|
45
50
|
end
|
46
51
|
|
47
52
|
def download!(remote, local=nil, options = {})
|
48
53
|
ssh.scp.download!(remote, local, options) do |ch, name, received, total|
|
49
|
-
|
54
|
+
percentage = (received.to_f * 100 / total.to_f).to_i
|
55
|
+
if percentage > 0 && percentage % 10 == 0
|
56
|
+
info "Downloading #{name} #{percentage}%"
|
57
|
+
else
|
58
|
+
debug "Downloading #{name} #{percentage}%"
|
59
|
+
end
|
50
60
|
end
|
51
61
|
end
|
52
62
|
|
data/lib/sshkit/version.rb
CHANGED