examples/api-samples/samples/sample17.rb in groupdocs-1.5.0 vs examples/api-samples/samples/sample17.rb in groupdocs-1.5.1
- old
+ new
@@ -10,11 +10,11 @@
set :private_key, params[:private_key]
set :file, params[:file]
begin
# check required variables
- raise "Please enter all required parameters" if settings.client_id.empty? or settings.private_key.empty? or settings.file.nil?
+ raise 'Please enter all required parameters' if settings.client_id.empty? or settings.private_key.empty? or settings.file.nil?
# construct path
filepath = "#{Dir.tmpdir}/#{params[:file][:filename]}"
# open file
File.open(filepath, 'wb') { |f| f.write(params[:file][:tempfile].read) }
@@ -30,7 +30,7 @@
rescue Exception => e
err = e.message
end
# set variables for template
- haml :sample17, :locals => { :userId => settings.client_id, :privateKey => settings.private_key, :iframe=>iframe, :massage => massage, :err => err }
+ haml :sample17, :locals => {:userId => settings.client_id, :privateKey => settings.private_key, :iframe => iframe, :massage => massage, :err => err}
end