def upload_file(source, dest, print_progress = false)
      Net::SSH.start(@address, @user, :password => @password) do |ssh|
        Log.info "Uploading file #{File.basename(source)}..." if print_progress
        ssh.scp.upload!(source, dest) do |ch, name, sent, total|
          if print_progress
            print "\rProgress: #{(sent.to_f * 100 / total.to_f).to_i}% completed"
          end
        end
      end
    end
def upload_file(source, dest, print_progress = false)
      Net::SSH.start(@address, @user, :password => @password) do |ssh|
        Log.info "Uploading file #{File.basename(source)}..." if print_progress
        ssh.scp.upload!(source, dest) do |ch, name, sent, total|
          if print_progress
            print "\rProgress: #{(sent.to_f * 100 / total.to_f).to_i}% completed"
          end
        end
      end
    end
Upload file