do 0.2.0.f → 0.2.0.g

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/do/server.rb +9 -8
  2. data/lib/do/version.rb +1 -1
  3. metadata +4 -4
@@ -140,11 +140,11 @@ module DO
140
140
  sftp.upload!(from, to, options) do |event, uploader, *args|
141
141
  case event
142
142
  when :put
143
- DO_LOGGER.print("\r" << DO_LOGGER_FORMAT % [user, name, "writing: #{to} (#{args[1] * 100 / args[0].size}%)"]); DO_LOGGER.flush
143
+ DO_LOGGER.print("\r" + DO_LOGGER_FORMAT % [user, name, "writing: #{args[0].local} (#{(args[1].to_f * 100 / args[0].size.to_f).to_i}%)"]); DO_LOGGER.flush
144
144
  when :finish
145
- DO_LOGGER.puts("\r" << DO_LOGGER_FORMAT % [user, name, "writing: #{to} (100%)"]); DO_LOGGER.flush
146
- when :mkdir
147
- log "creating directory #{args[0]}"
145
+ DO_LOGGER.puts("\r" + DO_LOGGER_FORMAT % [user, name, "writing: #{to} (100%)"]); DO_LOGGER.flush
146
+ # when :mkdir
147
+ # log "creating directory #{args[0]}"
148
148
  end
149
149
  end
150
150
  end
@@ -164,11 +164,12 @@ module DO
164
164
  sftp.download!(from, to, options) do |event, downloader, *args|
165
165
  case event
166
166
  when :get
167
- DO_LOGGER.print("\r" << DO_LOGGER_FORMAT % [user, name, "sending: #{from} (#{args[1] * 100 / args[0].size}%)"]); DO_LOGGER.flush
167
+ size = args[0].size ? args[0].size : sftp.stat!(from).size
168
+ DO_LOGGER.print("\r" + DO_LOGGER_FORMAT % [user, name, "sending: #{args[0].remote} (#{(args[1].to_f * 100 / size.to_f).to_i}%)"]); DO_LOGGER.flush
168
169
  when :finish
169
- DO_LOGGER.puts("\r" << DO_LOGGER_FORMAT % [user, name, "sending: #{from} (100%)"]); DO_LOGGER.flush
170
- when :mkdir
171
- log "creating directory #{args[0]}"
170
+ DO_LOGGER.puts("\r" + DO_LOGGER_FORMAT % [user, name, "sending: #{from} (100%)"]); DO_LOGGER.flush
171
+ # when :mkdir
172
+ # log "creating directory #{args[0]}"
172
173
  end
173
174
  end
174
175
  end
@@ -1,3 +1,3 @@
1
1
  module DO
2
- VERSION = '0.2.0.f' unless defined?(DO::VERSION)
2
+ VERSION = '0.2.0.g' unless defined?(DO::VERSION)
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: do
3
3
  version: !ruby/object:Gem::Version
4
- hash: 55
4
+ hash: 52
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
9
  - 0
10
- - f
11
- version: 0.2.0.f
10
+ - g
11
+ version: 0.2.0.g
12
12
  platform: ruby
13
13
  authors:
14
14
  - Davide D'Agostino
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-12-27 00:00:00 +01:00
19
+ date: 2012-01-11 00:00:00 +01:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency