Class: Travis::CLI::Gh::Upload
- Defined in:
- lib/travis/cli/gh/upload.rb
Constant Summary
Constants inherited from Write
Instance Method Summary collapse
Methods inherited from Write
#create, #create?, #get, #parse_user, #put, #update, #update?, #write
Methods included from GitHub::Authenticated
Methods included from GitHub::Error
Instance Method Details
#run(*paths) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/travis/cli/gh/upload.rb', line 9 def run(*paths) paths.each do |source| error "cannot read #{source}" unless File.readable? source target = File.basename(source) target = File.join(prefix, target) if prefix = "Uploading " << color(source, :important) << " as " << color(target, :important) if target != source say write(target, File.read(source)) end rescue GH::Error => e gh_error(e) end |