aspose_slides_cloud 24.7.0 → 24.9.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -153,6 +153,48 @@ describe 'UseCases' do
153
153
  expect(AsposeSlidesCloud::SpecUtils.testSlidesApi.object_exists(out_path).exists).to be true
154
154
  end
155
155
 
156
+ it 'async split' do
157
+ sleep_timeout = 3
158
+ max_tries = 10
159
+ folder_name = "TempSlidesSDK"
160
+ file_name = "test.pptx"
161
+ out_folder = "splitResult"
162
+ AsposeSlidesCloud::SpecUtils.testSlidesApi.delete_folder(out_folder, nil, true)
163
+ AsposeSlidesCloud::SpecUtils.testSlidesApi.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
164
+ operation_id = AsposeSlidesCloud::SpecUtils.testSlidesAsyncApi.start_split(file_name, AsposeSlidesCloud::ExportFormat::PDF, nil, nil, nil, nil, nil, out_folder, "password", folder_name)
165
+ for i in 1 .. max_tries do
166
+ sleep(sleep_timeout)
167
+ operation = AsposeSlidesCloud::SpecUtils.testSlidesAsyncApi.get_operation_status(operation_id)
168
+ if operation.status != 'Created' and operation.status != 'Enqueued' and operation.status != 'Started'
169
+ break
170
+ end
171
+ end
172
+ expect(operation.status).to eq('Finished')
173
+ expect(operation.error).to be_nil
174
+
175
+ expect(AsposeSlidesCloud::SpecUtils.testSlidesApi.object_exists(out_folder).exists).to be true
176
+ end
177
+
178
+ it 'async upload and split' do
179
+ sleep_timeout = 3
180
+ max_tries = 10
181
+ source = File.binread("TestData/test.pptx")
182
+ out_folder = "splitResult"
183
+ AsposeSlidesCloud::SpecUtils.testSlidesApi.delete_folder(out_folder, nil, true)
184
+ operation_id = AsposeSlidesCloud::SpecUtils.testSlidesAsyncApi.start_upload_and_split(source, AsposeSlidesCloud::ExportFormat::PDF, out_folder, nil, nil, nil, nil, "password")
185
+ for i in 1 .. max_tries do
186
+ sleep(sleep_timeout)
187
+ operation = AsposeSlidesCloud::SpecUtils.testSlidesAsyncApi.get_operation_status(operation_id)
188
+ if operation.status != 'Created' and operation.status != 'Enqueued' and operation.status != 'Started'
189
+ break
190
+ end
191
+ end
192
+ expect(operation.status).to eq('Finished')
193
+ expect(operation.error).to be_nil
194
+
195
+ expect(AsposeSlidesCloud::SpecUtils.testSlidesApi.object_exists(out_folder).exists).to be true
196
+ end
197
+
156
198
  it 'async bad operation' do
157
199
  sleep_timeout = 3
158
200
  max_tries = 10
@@ -35,13 +35,13 @@ describe 'UseCases' do
35
35
  file_name = "test.pptx"
36
36
  AsposeSlidesCloud::SpecUtils.testSlidesApi.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
37
37
  response = AsposeSlidesCloud::SpecUtils.testSlidesApi.get_fonts(file_name, "password", folder_name)
38
- expect(response.list.length).to eq(3)
38
+ expect(response.list.length).to eq(4)
39
39
  end
40
40
 
41
41
  it "get fonts online" do
42
42
  source = File.binread("TestData/test.pptx")
43
43
  response = AsposeSlidesCloud::SpecUtils.testSlidesApi.get_fonts_online(source, "password")
44
- expect(response.list.length).to eq(3)
44
+ expect(response.list.length).to eq(4)
45
45
  end
46
46
 
47
47
  it "set embedded font" do
@@ -50,7 +50,7 @@ describe 'UseCases' do
50
50
  font_name = "Calibri"
51
51
  AsposeSlidesCloud::SpecUtils.testSlidesApi.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
52
52
  response = AsposeSlidesCloud::SpecUtils.testSlidesApi.set_embedded_font(file_name, font_name, false, "password", folder_name)
53
- expect(response.list.length).to eq(3)
53
+ expect(response.list.length).to eq(4)
54
54
  expect(response.list[2].is_embedded).to eq(true)
55
55
  expect(response.list[2].font_name).to eq(font_name)
56
56
  end
@@ -69,7 +69,7 @@ describe 'UseCases' do
69
69
  source = File.binread("TestData/calibri.ttf")
70
70
  AsposeSlidesCloud::SpecUtils.testSlidesApi.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
71
71
  response = AsposeSlidesCloud::SpecUtils.testSlidesApi.set_embedded_font_from_request(source, file_name, false, "password", folder_name)
72
- expect(response.list.length).to eq(3)
72
+ expect(response.list.length).to eq(4)
73
73
  expect(response.list[2].is_embedded).to eq(true)
74
74
  expect(response.list[2].font_name).to eq(font_name)
75
75
  end
@@ -49,6 +49,8 @@ describe 'UseCases' do
49
49
  AsposeSlidesCloud::SpecUtils.testSlidesApi.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
50
50
  result = AsposeSlidesCloud::SpecUtils.testSlidesApi.replace_presentation_text(file_name, old_value, new_value, nil, nil, password, folder_name)
51
51
  AsposeSlidesCloud::SpecUtils.testSlidesApi.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
52
+ result_regex = AsposeSlidesCloud::SpecUtils.testSlidesApi.replace_presentation_regex(file_name, old_value, new_value, nil, password, folder_name)
53
+ AsposeSlidesCloud::SpecUtils.testSlidesApi.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
52
54
  result_with_empty = AsposeSlidesCloud::SpecUtils.testSlidesApi.replace_presentation_text(file_name, old_value, new_value, true, nil, password, folder_name)
53
55
  AsposeSlidesCloud::SpecUtils.testSlidesApi.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
54
56
  result_whole_words = AsposeSlidesCloud::SpecUtils.testSlidesApi.replace_presentation_text(file_name, old_value, new_value, true, true, password, folder_name)
@@ -56,6 +58,7 @@ describe 'UseCases' do
56
58
  slide_result = AsposeSlidesCloud::SpecUtils.testSlidesApi.replace_slide_text(file_name, slide_index, old_value, new_value, nil, password, folder_name)
57
59
  AsposeSlidesCloud::SpecUtils.testSlidesApi.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
58
60
  slide_result_with_empty = AsposeSlidesCloud::SpecUtils.testSlidesApi.replace_slide_text(file_name, slide_index, old_value, new_value, true, password, folder_name)
61
+ expect(result_regex.matches).to eq(result.matches)
59
62
  expect(result_with_empty.matches).to be > result.matches
60
63
  expect(result_with_empty.matches).to be > result_whole_words.matches
61
64
  expect(result.matches).to be > slide_result.matches
@@ -69,6 +72,7 @@ describe 'UseCases' do
69
72
  new_value = "new_text"
70
73
  source = File.binread("TestData/test.pptx")
71
74
  AsposeSlidesCloud::SpecUtils.testSlidesApi.replace_presentation_text_online(source, old_value, new_value, nil, nil, password)
75
+ AsposeSlidesCloud::SpecUtils.testSlidesApi.replace_presentation_regex_online(source, old_value, new_value, nil, password)
72
76
  AsposeSlidesCloud::SpecUtils.testSlidesApi.replace_presentation_text_online(source, old_value, new_value, true, nil, password)
73
77
  AsposeSlidesCloud::SpecUtils.testSlidesApi.replace_slide_text_online(source, slide_index, old_value, new_value, nil, password)
74
78
  AsposeSlidesCloud::SpecUtils.testSlidesApi.replace_slide_text_online(source, slide_index, old_value, new_value, true, password)
@@ -118,8 +122,7 @@ describe 'UseCases' do
118
122
  highlight_color = "#FFF5FF8A"
119
123
  text_to_highlight = "highlight"
120
124
  AsposeSlidesCloud::SpecUtils.testSlidesApi.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
121
- AsposeSlidesCloud::SpecUtils.testSlidesApi.highlight_shape_text(file_name, slide_index, shape_index, text_to_highlight, highlight_color,
122
- nil, false, password, folder_name)
125
+ AsposeSlidesCloud::SpecUtils.testSlidesApi.highlight_shape_text(file_name, slide_index, shape_index, text_to_highlight, highlight_color, nil, false, password, folder_name)
123
126
  para = AsposeSlidesCloud::SpecUtils.testSlidesApi.get_paragraph(file_name, slide_index, shape_index, paragraph_index, password, folder_name)
124
127
  expect(para.portion_list[0].text).not_to eq(text_to_highlight)
125
128
  expect(para.portion_list[0].highlight_color).not_to eq(highlight_color)
@@ -138,13 +141,55 @@ describe 'UseCases' do
138
141
  highlight_color = "#FFF5FF8A"
139
142
  regex = "h.ghl[abci]ght"
140
143
  AsposeSlidesCloud::SpecUtils.testSlidesApi.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
141
- AsposeSlidesCloud::SpecUtils.testSlidesApi.highlight_shape_regex(file_name, slide_index, shape_index, regex, highlight_color,
142
- nil, false, password, folder_name)
144
+ AsposeSlidesCloud::SpecUtils.testSlidesApi.highlight_shape_regex(file_name, slide_index, shape_index, regex, highlight_color, false, password, folder_name)
143
145
  para = AsposeSlidesCloud::SpecUtils.testSlidesApi.get_paragraph(file_name, slide_index, shape_index, paragraph_index, password, folder_name)
144
146
  expect(para.portion_list[0].text).not_to eq(text_to_highlight)
145
147
  expect(para.portion_list[0].highlight_color).not_to eq(highlight_color)
146
148
  expect(para.portion_list[1].text).to eq(text_to_highlight)
147
149
  expect(para.portion_list[1].highlight_color).to eq(highlight_color)
148
- end
150
+ end
151
+
152
+ it "highlight presentation text" do
153
+ folder_name = "TempSlidesSDK"
154
+ file_name = "test.pptx"
155
+ password = "password"
156
+ highlight_color = "#FFF5FF8A"
157
+ text_to_highlight = "highlight"
158
+ AsposeSlidesCloud::SpecUtils.testSlidesApi.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
159
+ result = AsposeSlidesCloud::SpecUtils.testSlidesApi.highlight_presentation_text(file_name, text_to_highlight, highlight_color, nil, false, password, folder_name)
160
+ result_ignore_case = AsposeSlidesCloud::SpecUtils.testSlidesApi.highlight_presentation_text(file_name, text_to_highlight, highlight_color, nil, true, password, folder_name)
161
+ expect(result_ignore_case.matches).to eq(result.matches)
162
+
163
+ slide_index = 6
164
+ shape_index = 1
165
+ paragraph_index = 1
166
+ para = AsposeSlidesCloud::SpecUtils.testSlidesApi.get_paragraph(file_name, slide_index, shape_index, paragraph_index, password, folder_name)
167
+ expect(para.portion_list[0].text).not_to eq(text_to_highlight)
168
+ expect(para.portion_list[0].highlight_color).not_to eq(highlight_color)
169
+ expect(para.portion_list[1].text).to eq(text_to_highlight)
170
+ expect(para.portion_list[1].highlight_color).to eq(highlight_color)
171
+ end
172
+
173
+ it "highlight presentation regex" do
174
+ folder_name = "TempSlidesSDK"
175
+ file_name = "test.pptx"
176
+ password = "password"
177
+ text_to_highlight = "highlight"
178
+ highlight_color = "#FFF5FF8A"
179
+ regex = "h.ghl[abci]ght"
180
+ AsposeSlidesCloud::SpecUtils.testSlidesApi.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
181
+ result = AsposeSlidesCloud::SpecUtils.testSlidesApi.highlight_presentation_regex(file_name, regex, highlight_color, false, password, folder_name)
182
+ result_ignore_case = AsposeSlidesCloud::SpecUtils.testSlidesApi.highlight_presentation_regex(file_name, regex, highlight_color, true, password, folder_name)
183
+ expect(result_ignore_case.matches).to eq(result.matches)
184
+
185
+ slide_index = 6
186
+ shape_index = 1
187
+ paragraph_index = 1
188
+ para = AsposeSlidesCloud::SpecUtils.testSlidesApi.get_paragraph(file_name, slide_index, shape_index, paragraph_index, password, folder_name)
189
+ expect(para.portion_list[0].text).not_to eq(text_to_highlight)
190
+ expect(para.portion_list[0].highlight_color).not_to eq(highlight_color)
191
+ expect(para.portion_list[1].text).to eq(text_to_highlight)
192
+ expect(para.portion_list[1].highlight_color).to eq(highlight_color)
193
+ end
149
194
  end
150
195
  end
data/testRules.json CHANGED
@@ -157,6 +157,7 @@
157
157
  { "Parameter": "Html" },
158
158
  { "Parameter": "Text" },
159
159
  { "Parameter": "Regex" },
160
+ { "Parameter": "Pattern" },
160
161
  { "Parameter": "Name", "Method": "/CreatePresentation/" },
161
162
  { "Parameter": "Name", "Method": "/ImportFrom/" },
162
163
  { "Parameter": "Folder", "Method": "/CreatePresentation/" },
@@ -168,6 +169,8 @@
168
169
  { "Parameter": "Name", "Method": "/^Start/" },
169
170
  { "Parameter": "Password", "Method": "/^Start/" },
170
171
  { "Parameter": "Slides", "Method": "/^Start/" },
172
+ { "Parameter": "From", "Method": "/^Start/" },
173
+ { "Parameter": "To", "Method": "/^Start/" },
171
174
  { "Parameter": "LayoutAlias" },
172
175
  { "Parameter": "ShapeName" },
173
176
  { "Parameter": "Files" },
@@ -223,6 +226,7 @@
223
226
  { "Message": " required parameter", "Type": "model" },
224
227
  { "Message": "Failed to load the presentation", "Parameter": "Request", "Method": "/Merge.*Online/" },
225
228
  { "Message": "Invalid Request", "Parameter": "VersionId" },
229
+ { "Message": "Invalid version", "Parameter": "VersionId", "Method": "Download" },
226
230
  { "Message": "AmazonS3 Storage exception", "Parameter": "VersionId", "Method": "ObjectExists" },
227
231
  { "Message": "Invalid version id specified", "Parameter": "VersionId", "Method": "DeleteFile" },
228
232
  { "Message": "Invalid version id specified", "Parameter": "VersionId", "Method": "DownloadFile" },
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aspose_slides_cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 24.7.0
4
+ version: 24.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Putrov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-25 00:00:00.000000000 Z
11
+ date: 2024-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -444,6 +444,7 @@ files:
444
444
  - lib/aspose_slides_cloud/models/one_value_chart_data_point.rb
445
445
  - lib/aspose_slides_cloud/models/one_value_series.rb
446
446
  - lib/aspose_slides_cloud/models/operation.rb
447
+ - lib/aspose_slides_cloud/models/operation_error.rb
447
448
  - lib/aspose_slides_cloud/models/operation_progress.rb
448
449
  - lib/aspose_slides_cloud/models/ordered_merge_request.rb
449
450
  - lib/aspose_slides_cloud/models/outer_shadow_effect.rb