Class: Helm::Commands::Upload

Inherits:
Command
  • Object
show all
Defined in:
lib/helm/commands/upload.rb

Instance Attribute Summary

Attributes inherited from Command

#session

Instance Method Summary collapse

Methods inherited from Command

#cache, #format, #initialize, #parameters

Constructor Details

This class inherits a constructor from Helm::Commands::Command

Instance Method Details

#runObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/helm/commands/upload.rb', line 4

def run
  parameters :ticket, :filename

  ensure_filename!

  login!

  agent.get url(session.ticket_path(ticket)) do |page|
    form = page.form_with(:enctype => 'multipart/form-data')

    form.file_uploads.first.file_name = filename

    agent.submit(form)
  end
end