lib/vmc/client.rb in vmc-0.2.6 vs lib/vmc/client.rb in vmc-0.2.10
- old
+ new
@@ -85,15 +85,18 @@
def upload_app(name, zipfile, resource_manifest=nil)
#FIXME, manifest should be allowed to be null, here for compatability with old cc's
resource_manifest ||= []
check_login_status
- if zipfile.is_a? File
- file = zipfile
- else
- file = File.new(zipfile, 'rb')
+ upload_data = {:_method => 'put'}
+ if zipfile
+ if zipfile.is_a? File
+ file = zipfile
+ else
+ file = File.new(zipfile, 'rb')
+ end
+ upload_data[:application] = file
end
- upload_data = {:application => file, :_method => 'put'}
upload_data[:resources] = resource_manifest.to_json if resource_manifest
http_post("#{VMC::APPS_PATH}/#{name}/application", upload_data)
end
def delete_app(name)