examples/api-samples/samples/sample20.rb in groupdocs-1.5.0 vs examples/api-samples/samples/sample20.rb in groupdocs-1.5.1
- old
+ new
@@ -11,20 +11,20 @@
set :resultFileId, params[:resultFileId]
begin
# check required variables
- raise "Please enter all required parameters" if settings.client_id.empty? or settings.private_key.empty? or settings.resultFileId.empty?
+ raise 'Please enter all required parameters' if settings.client_id.empty? or settings.private_key.empty? or settings.resultFileId.empty?
# construct new storage file
file = GroupDocs::Storage::File.new(guid: settings.resultFileId)
# construct new document
document = GroupDocs::Document.new(file: file)
# get compare changes
changes = document.changes!({:client_id => settings.client_id, :private_key => settings.private_key})
- result = ""
+ result = ''
result += "<table class='border'>"
result += "<tr><td><font color='green'>Change Name</font></td><td><font color='green'>Change</font></td></tr>"
changes.each do |change|
result += "<tr><td>id</td><td>#{change.id}</td></tr>"
result += "<tr><td>type</td><td>#{change.type}</td></tr>"
@@ -37,14 +37,14 @@
result += "<tr><td>box weight</td><td>#{change.box.width}</td></tr>"
result += "<tr><td>box height</td><td>#{change.box.height}</td></tr>"
result += "<tr bgcolor='#808080'><td></td><td></td></tr>"
end
- result += "</table>"
+ result += '</table>'
rescue Exception => e
err = e.message
end
# set variables for template
- haml :sample20, :locals => { :userId => settings.client_id, :privateKey => settings.private_key, :resultFileId => settings.resultFileId, :result => result, :err => err }
+ haml :sample20, :locals => {:userId => settings.client_id, :privateKey => settings.private_key, :resultFileId => settings.resultFileId, :result => result, :err => err}
end