@@ -274,7 +274,7 @@ def File.upload(destination, *src_files, &stat)
274
274
def File . upload_file ( dest_file , src_file , &stat )
275
275
# Open the file on the remote side for writing and read
276
276
# all of the contents of the local file
277
- stat . call ( 'uploading' , src_file , dest_file ) if ( stat )
277
+ stat . call ( 'uploading' , src_file , dest_file ) if stat
278
278
dest_fd = nil
279
279
src_fd = nil
280
280
buf_size = 8 * 1024 * 1024
@@ -288,13 +288,13 @@ def File.upload_file(dest_file, src_file, &stat)
288
288
percent = dest_fd . pos . to_f / src_size . to_f * 100.0
289
289
msg = "Uploaded #{ Filesize . new ( dest_fd . pos ) . pretty } of " \
290
290
"#{ Filesize . new ( src_size ) . pretty } (#{ percent . round ( 2 ) } %)"
291
- stat . call ( msg , src_file , dest_file )
291
+ stat . call ( msg , src_file , dest_file ) if stat
292
292
end
293
293
ensure
294
294
src_fd . close unless src_fd . nil?
295
295
dest_fd . close unless dest_fd . nil?
296
296
end
297
- stat . call ( 'uploaded' , src_file , dest_file ) if ( stat )
297
+ stat . call ( 'uploaded' , src_file , dest_file ) if stat
298
298
end
299
299
300
300
def File . is_glob? ( name )
0 commit comments