Skip to content

Commit

Permalink
Manually recreated changes
Browse files Browse the repository at this point in the history
  • Loading branch information
neuzebeoneclass committed Jun 20, 2018
1 parent 9d0a903 commit 993c566
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
17 changes: 15 additions & 2 deletions lib/cloud_convert/process.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,27 @@ def create
def convert(opts)
raise CloudConvert::InvalidStep if @step == :awaiting_creation
url = process_url()
multi = opts[:file].respond_to?("read")
if opts[:file].response_to?("read")
file_to_upload = opts[:file]
opts.delete(:file)
end
response = send_request(http_method: :post,
url: url,
params: opts,
multi: multi) do |response|
multi: false) do |response|
response.parsed_response[:success] = true
create_parsed_response(:conversion_response, response.parsed_response)
@step = @conversion_response[:step].to_sym

if(file_to_upload)
send_request(http_method: :post,
url: "#{CloudConvert::PROTOCOL}:#{@conversion_response[:upload][:url]}",
params: {
"file": file_to_upload
},
multi: true)
end

end
return convert_response response
end
Expand Down
2 changes: 1 addition & 1 deletion lib/cloud_convert/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module CloudConvert
module VERSION_VALUES #:nodoc:
MAJOR = '0'
MINOR = '1'
TINY = '8'
TINY = '9'
BETA = nil # Time.now.to_i.to_s
end

Expand Down

0 comments on commit 993c566

Please sign in to comment.