lib/rmega/uploader.rb in rmega-0.1.0 vs lib/rmega/uploader.rb in rmega-0.1.1
- old
+ new
@@ -35,18 +35,18 @@
end
def upload(&block)
@local_file = ::File.open(local_path, 'rb')
- progress = Progress.new(filesize: filesize, verb: 'upload')
+ progress = Progress.new(total: filesize, caption: 'Upload')
chunks.each do |start, size|
pool.defer do
- clean_buffer = pool.syncronize { read_chunk(start, size) }
+ clean_buffer = pool.synchronize { read_chunk(start, size) }
encrypted_buffer = yield(start, clean_buffer)
@last_result = upload_chunk(start, encrypted_buffer)
- progress.increment(buffer.size)
+ progress.increment(clean_buffer.size)
end
end
pool.wait_done
pool.shutdown