Skip to content

Commit a4d3602

Browse files
Merge branch 'master' into release
2 parents 779f854 + 6645f60 commit a4d3602

File tree

12 files changed

+183
-12
lines changed

12 files changed

+183
-12
lines changed

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,15 @@ This repository contains Aspose.Words Cloud SDK for Ruby source code. This SDK a
1313
* Watermarks and protection
1414
* Full read & write access to Document Object Model, including sections, paragraphs, text, images, tables, headers/footers and many others
1515

16+
## Enhancements in Version 21.6
17+
18+
- Implemented beta version of CompareDocumentOnline feature with both document sending in request
19+
- CompareDocument method now can handle PDF files
20+
21+
1622
## Enhancements in Version 21.5
1723

18-
- Updated dependencies in sdk
19-
- Implemented Batch API
24+
- Update dependencies in sdk
2025

2126

2227
## Enhancements in Version 21.4
@@ -130,7 +135,7 @@ To use Aspose Words for Cloud Ruby SDK you need to register an account with [Asp
130135
To install this package do the following:
131136
update your Gemfile
132137
```ruby
133-
gem 'aspose_words_cloud', '~> 21.5'
138+
gem 'aspose_words_cloud', '~> 21.6'
134139
```
135140
or install directly
136141
```bash
34.1 KB
Binary file not shown.
31.7 KB
Binary file not shown.

lib/aspose_words_cloud/api/words_api.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -987,6 +987,7 @@ def compare_document_online(request)
987987
form_params = {}
988988
form_params[downcase_first_letter('Document')] = request.document
989989
form_params[downcase_first_letter('CompareData')] = request.compare_data.to_body.to_json
990+
form_params[downcase_first_letter('ComparingDocument')] = request.comparing_document
990991

991992
# http body (model)
992993
post_body = nil

lib/aspose_words_cloud/api_client.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,9 +352,10 @@ def download_file(response)
352352
def download_file_from_multipart(body)
353353
prefix = 'download-'
354354
prefix += '-' unless prefix.end_with?('-')
355-
tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding:body.encoding)
355+
tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding:body.encoding, binmode: true)
356356
@tempfile = tempfile
357357
tempfile.write(body)
358+
tempfile.size
358359
@config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
359360
"with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
360361
"will be deleted automatically with GC. It's also recommended to delete the temp file "\

lib/aspose_words_cloud/models/compare_options.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ module AsposeWordsCloud
2929

3030
# DTO container with compare documents options.
3131
class CompareOptions
32+
# Gets or sets whether accept revisions before comparison or not.
33+
attr_accessor :accept_all_revisions_before_comparison
34+
3235
# Gets or sets a value indicating whether documents comparison is case insensitive. By default comparison is case sensitive.
3336
attr_accessor :ignore_case_changes
3437

@@ -81,6 +84,7 @@ def valid?(value)
8184
# Attribute mapping from ruby-style variable name to JSON key.
8285
def self.attribute_map
8386
{
87+
:'accept_all_revisions_before_comparison' => :'AcceptAllRevisionsBeforeComparison',
8488
:'ignore_case_changes' => :'IgnoreCaseChanges',
8589
:'ignore_comments' => :'IgnoreComments',
8690
:'ignore_fields' => :'IgnoreFields',
@@ -96,6 +100,7 @@ def self.attribute_map
96100
# Attribute type mapping.
97101
def self.swagger_types
98102
{
103+
:'accept_all_revisions_before_comparison' => :'BOOLEAN',
99104
:'ignore_case_changes' => :'BOOLEAN',
100105
:'ignore_comments' => :'BOOLEAN',
101106
:'ignore_fields' => :'BOOLEAN',
@@ -116,6 +121,10 @@ def initialize(attributes = {})
116121
# convert string to symbol for hash key
117122
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
118123

124+
if attributes.key?(:'AcceptAllRevisionsBeforeComparison')
125+
self.accept_all_revisions_before_comparison = attributes[:'AcceptAllRevisionsBeforeComparison']
126+
end
127+
119128
if attributes.key?(:'IgnoreCaseChanges')
120129
self.ignore_case_changes = attributes[:'IgnoreCaseChanges']
121130
end
@@ -189,6 +198,7 @@ def target=(target)
189198
def ==(other)
190199
return true if self.equal?(other)
191200
self.class == other.class &&
201+
accept_all_revisions_before_comparison == other.accept_all_revisions_before_comparison &&
192202
ignore_case_changes == other.ignore_case_changes &&
193203
ignore_comments == other.ignore_comments &&
194204
ignore_fields == other.ignore_fields &&
@@ -209,7 +219,7 @@ def eql?(other)
209219
# Calculates hash code according to all attributes.
210220
# @return [Fixnum] Hash code
211221
def hash
212-
[ignore_case_changes, ignore_comments, ignore_fields, ignore_footnotes, ignore_formatting, ignore_headers_and_footers, ignore_tables, ignore_textboxes, target].hash
222+
[accept_all_revisions_before_comparison, ignore_case_changes, ignore_comments, ignore_fields, ignore_footnotes, ignore_formatting, ignore_headers_and_footers, ignore_tables, ignore_textboxes, target].hash
213223
end
214224

215225
# Builds the object from hash

lib/aspose_words_cloud/models/requests/compare_document_online_request.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ class CompareDocumentOnlineRequest
3535
# Compare data.
3636
attr_accessor :compare_data
3737

38+
# The comparing document.
39+
attr_accessor :comparing_document
40+
3841
# Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
3942
attr_accessor :load_encoding
4043

@@ -48,13 +51,15 @@ class CompareDocumentOnlineRequest
4851
# Initializes a new instance.
4952
# @param document The document.
5053
# @param compare_data Compare data.
54+
# @param comparing_document The comparing document.
5155
# @param load_encoding Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
5256
# @param password Password for opening an encrypted document.
5357
# @param dest_file_name Result path of the document after the operation. If this parameter is omitted then result of the operation will be saved as the source document.
5458

55-
def initialize(document, compare_data, load_encoding = nil, password = nil, dest_file_name = nil)
59+
def initialize(document, compare_data, comparing_document = nil, load_encoding = nil, password = nil, dest_file_name = nil)
5660
self.document = document
5761
self.compare_data = compare_data
62+
self.comparing_document = comparing_document
5863
self.load_encoding = load_encoding
5964
self.password = password
6065
self.dest_file_name = dest_file_name
@@ -90,6 +95,7 @@ def to_batch_part(api_client)
9095
form_params = {}
9196
form_params[downcase_first_letter('Document')] = self.document
9297
form_params[downcase_first_letter('CompareData')] = self.compare_data.to_body.to_json
98+
form_params[downcase_first_letter('ComparingDocument')] = self.comparing_document unless self.comparing_document.nil?
9399

94100
# http body (model)
95101
post_body = nil
@@ -139,6 +145,7 @@ def create_http_request(api_client)
139145
form_params = {}
140146
form_params[downcase_first_letter('Document')] = self.document
141147
form_params[downcase_first_letter('CompareData')] = self.compare_data.to_body.to_json
148+
form_params[downcase_first_letter('ComparingDocument')] = self.comparing_document unless self.comparing_document.nil?
142149

143150
# http body (model)
144151
post_body = nil

lib/aspose_words_cloud/models/requests/execute_mail_merge_request.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def to_batch_part(api_client)
123123

124124
# form parameters
125125
form_params = {}
126-
form_params[downcase_first_letter('Data')] = self.data
126+
form_params[downcase_first_letter('Data')] = self.data unless self.data.nil?
127127

128128
# http body (model)
129129
post_body = nil
@@ -176,7 +176,7 @@ def create_http_request(api_client)
176176

177177
# form parameters
178178
form_params = {}
179-
form_params[downcase_first_letter('Data')] = self.data
179+
form_params[downcase_first_letter('Data')] = self.data unless self.data.nil?
180180

181181
# http body (model)
182182
post_body = nil

lib/aspose_words_cloud/models/requests/insert_watermark_image_request.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def to_batch_part(api_client)
123123

124124
# form parameters
125125
form_params = {}
126-
form_params[downcase_first_letter('ImageFile')] = self.image_file
126+
form_params[downcase_first_letter('ImageFile')] = self.image_file unless self.image_file.nil?
127127

128128
# http body (model)
129129
post_body = nil
@@ -176,7 +176,7 @@ def create_http_request(api_client)
176176

177177
# form parameters
178178
form_params = {}
179-
form_params[downcase_first_letter('ImageFile')] = self.image_file
179+
form_params[downcase_first_letter('ImageFile')] = self.image_file unless self.image_file.nil?
180180

181181
# http body (model)
182182
post_body = nil

lib/aspose_words_cloud/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@
2424
# ------------------------------------------------------------------------------------
2525

2626
module AsposeWordsCloud
27-
VERSION = "21.5.1".freeze
27+
VERSION = "21.6.0".freeze
2828
end

0 commit comments

Comments
 (0)