Method: CoderCompanion::API#upload

Defined in:
lib/codercompanion/api.rb

#upload(file) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/codercompanion/api.rb', line 14

def upload(file)
    response = nil
    begin
        response = RestClient.post(config[:host] + '/update_project.json', :myfile => File.new(file),# /Users/oseghale/Projects/JinglePage/JingleParser/test_upload.jingle'), 
                                    :access_key => config[:access_key], :access_id => config[:access_id]) { |response, request, result, &block|
            return response.code || nil 
        }
    rescue
        return GENERIC_ERROR
        
    end
    
end