lib/softcover/uploader.rb in softcover-0.7.10 vs lib/softcover/uploader.rb in softcover-0.7.11
- old
+ new
@@ -13,13 +13,15 @@
@after_each_blk = blk
end
def upload!(options={})
unless @params.empty?
- bar = ProgressBar.create title: "Starting Upload...",
- format: "%t |%B| %P%% %e", total: total_size, smoothing: 0.75,
- output: Softcover::Output.stream
+ bar = ProgressBar.create title: "Starting Upload...",
+ format: "%t |%B| %P%% %e",
+ total: total_size,
+ smoothing: 0.75,
+ output: Softcover::Output.stream
upload_host = "http://#{@bucket}.s3.amazonaws.com"
@params.each do |params|
path = params['path']
@@ -32,10 +34,10 @@
last_chunk = 0
c.on_progress do |_, _, ul_total, ul_now|
uploaded = ul_now > size ? size : ul_now
- bar.title = "#{path} (#{as_size uploaded} / #{as_size size})"
+ bar.send(:title=, "#{path} (#{as_size uploaded} / #{as_size size})")
bar.progress += ul_now - last_chunk rescue nil
last_chunk = ul_now
true
end
\ No newline at end of file