4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/appfog-vmc-plugin/cfoundry/v1/base.rb', line 4
def upload_app(name, zipfile, resources = [])
payload = {
:_method => "put",
:application =>
UploadIO.new(
if zipfile.is_a? File
zipfile
elsif zipfile.is_a? String
File.new(zipfile, "rb")
end,
"application/zip"),
:resources => MultiJson.dump(resources)
}
post("apps", name, "application", :payload => payload, :multipart => true, :accept => '*/*; q=0.5, application/xml')
rescue EOFError
retry
end
|