class Egads::Upload

Attributes

sha[R]

Public Instance Methods

upload() click to toggle source
# File lib/egads/command/upload.rb, line 9
def upload
  @sha = sha
  size = File.size(path)
  type = 'patch'

  say_status :upload, "Uploading #{type} tarball (%.1f MB)" % (size.to_f / 2**20), :yellow
  duration = Benchmark.realtime do
    tarball.upload(path)
  end
  say_status :done, "Uploaded in %.1f seconds (%.1f KB/s)" % [duration, (size.to_f / 2**10) / duration]

  File.delete(path)
end

Private Instance Methods

path() click to toggle source
# File lib/egads/command/upload.rb, line 28
def path
  tarball.local_tar_path
end
tarball() click to toggle source
# File lib/egads/command/upload.rb, line 24
def tarball
  @tarball ||= S3Tarball.new(sha, seed: false)
end