aspose_slides_cloud 24.6.0 → 24.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +9 -7
  3. data/README.md +20 -0
  4. data/TestData/pictureFrame.html +39 -0
  5. data/TestData/test.pptx +0 -0
  6. data/aspose_slides_cloud.gemspec +1 -0
  7. data/lib/aspose_slides_cloud/api/slides_api.rb +373 -210
  8. data/lib/aspose_slides_cloud/api/slides_async_api.rb +179 -8
  9. data/lib/aspose_slides_cloud/api_client.rb +3 -0
  10. data/lib/aspose_slides_cloud/models/document_property.rb +0 -5
  11. data/lib/aspose_slides_cloud/models/export_format.rb +1 -0
  12. data/lib/aspose_slides_cloud/models/export_options.rb +23 -1
  13. data/lib/aspose_slides_cloud/models/gif_export_options.rb +2 -1
  14. data/lib/aspose_slides_cloud/models/gradient_fill.rb +0 -25
  15. data/lib/aspose_slides_cloud/models/html5_export_options.rb +13 -2
  16. data/lib/aspose_slides_cloud/models/html_export_options.rb +2 -1
  17. data/lib/aspose_slides_cloud/models/image_export_options.rb +2 -1
  18. data/lib/aspose_slides_cloud/models/image_export_options_base.rb +2 -1
  19. data/lib/aspose_slides_cloud/models/markdown_export_options.rb +2 -1
  20. data/lib/aspose_slides_cloud/models/ole_object_frame.rb +0 -5
  21. data/lib/aspose_slides_cloud/models/operation.rb +3 -3
  22. data/lib/aspose_slides_cloud/models/operation_error.rb +121 -0
  23. data/lib/aspose_slides_cloud/models/pdf_export_options.rb +13 -2
  24. data/lib/aspose_slides_cloud/models/pptx_export_options.rb +26 -3
  25. data/lib/aspose_slides_cloud/models/protection_properties.rb +0 -10
  26. data/lib/aspose_slides_cloud/models/save.rb +2 -2
  27. data/lib/aspose_slides_cloud/models/save_slide.rb +2 -2
  28. data/lib/aspose_slides_cloud/models/slide.rb +0 -5
  29. data/lib/aspose_slides_cloud/models/slide_export_format.rb +1 -0
  30. data/lib/aspose_slides_cloud/models/smart_art.rb +0 -5
  31. data/lib/aspose_slides_cloud/models/smart_art_node.rb +0 -5
  32. data/lib/aspose_slides_cloud/models/svg_export_options.rb +2 -1
  33. data/lib/aspose_slides_cloud/models/swf_export_options.rb +2 -1
  34. data/lib/aspose_slides_cloud/models/table.rb +12 -2
  35. data/lib/aspose_slides_cloud/models/table_cell.rb +11 -1
  36. data/lib/aspose_slides_cloud/models/table_cell_merge_options.rb +0 -5
  37. data/lib/aspose_slides_cloud/models/tiff_export_options.rb +2 -1
  38. data/lib/aspose_slides_cloud/models/video_export_options.rb +2 -1
  39. data/lib/aspose_slides_cloud/models/xaml_export_options.rb +2 -1
  40. data/lib/aspose_slides_cloud/models/xps_export_options.rb +2 -1
  41. data/lib/aspose_slides_cloud/type_registry.rb +1 -0
  42. data/lib/aspose_slides_cloud/version.rb +1 -1
  43. data/lib/aspose_slides_cloud.rb +1 -0
  44. data/spec/api/slides_api_spec.rb +1080 -757
  45. data/spec/api/slides_async_api_spec.rb +773 -0
  46. data/spec/use_cases/async_api_spec.rb +42 -0
  47. data/spec/use_cases/font_spec.rb +4 -4
  48. data/spec/use_cases/text_spec.rb +57 -9
  49. data/testRules.json +3 -0
  50. metadata +24 -2
@@ -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
@@ -47,14 +47,20 @@ describe 'UseCases' do
47
47
  old_value = "text"
48
48
  new_value = "new_text"
49
49
  AsposeSlidesCloud::SpecUtils.testSlidesApi.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
50
- result = AsposeSlidesCloud::SpecUtils.testSlidesApi.replace_presentation_text(file_name, old_value, new_value, nil, password, folder_name)
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_with_empty = AsposeSlidesCloud::SpecUtils.testSlidesApi.replace_presentation_text(file_name, old_value, new_value, true, password, folder_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)
54
+ result_with_empty = AsposeSlidesCloud::SpecUtils.testSlidesApi.replace_presentation_text(file_name, old_value, new_value, true, nil, password, folder_name)
55
+ AsposeSlidesCloud::SpecUtils.testSlidesApi.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
56
+ result_whole_words = AsposeSlidesCloud::SpecUtils.testSlidesApi.replace_presentation_text(file_name, old_value, new_value, true, true, password, folder_name)
53
57
  AsposeSlidesCloud::SpecUtils.testSlidesApi.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
54
58
  slide_result = AsposeSlidesCloud::SpecUtils.testSlidesApi.replace_slide_text(file_name, slide_index, old_value, new_value, nil, password, folder_name)
55
59
  AsposeSlidesCloud::SpecUtils.testSlidesApi.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
56
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)
57
62
  expect(result_with_empty.matches).to be > result.matches
63
+ expect(result_with_empty.matches).to be > result_whole_words.matches
58
64
  expect(result.matches).to be > slide_result.matches
59
65
  expect(slide_result_with_empty.matches).to be > slide_result.matches
60
66
  end
@@ -65,8 +71,9 @@ describe 'UseCases' do
65
71
  old_value = "text"
66
72
  new_value = "new_text"
67
73
  source = File.binread("TestData/test.pptx")
68
- AsposeSlidesCloud::SpecUtils.testSlidesApi.replace_presentation_text_online(source, old_value, new_value, nil, password)
69
- AsposeSlidesCloud::SpecUtils.testSlidesApi.replace_presentation_text_online(source, old_value, new_value, true, password)
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)
76
+ AsposeSlidesCloud::SpecUtils.testSlidesApi.replace_presentation_text_online(source, old_value, new_value, true, nil, password)
70
77
  AsposeSlidesCloud::SpecUtils.testSlidesApi.replace_slide_text_online(source, slide_index, old_value, new_value, nil, password)
71
78
  AsposeSlidesCloud::SpecUtils.testSlidesApi.replace_slide_text_online(source, slide_index, old_value, new_value, true, password)
72
79
  end
@@ -115,8 +122,7 @@ describe 'UseCases' do
115
122
  highlight_color = "#FFF5FF8A"
116
123
  text_to_highlight = "highlight"
117
124
  AsposeSlidesCloud::SpecUtils.testSlidesApi.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
118
- AsposeSlidesCloud::SpecUtils.testSlidesApi.highlight_shape_text(file_name, slide_index, shape_index, text_to_highlight, highlight_color,
119
- 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)
120
126
  para = AsposeSlidesCloud::SpecUtils.testSlidesApi.get_paragraph(file_name, slide_index, shape_index, paragraph_index, password, folder_name)
121
127
  expect(para.portion_list[0].text).not_to eq(text_to_highlight)
122
128
  expect(para.portion_list[0].highlight_color).not_to eq(highlight_color)
@@ -135,13 +141,55 @@ describe 'UseCases' do
135
141
  highlight_color = "#FFF5FF8A"
136
142
  regex = "h.ghl[abci]ght"
137
143
  AsposeSlidesCloud::SpecUtils.testSlidesApi.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
138
- AsposeSlidesCloud::SpecUtils.testSlidesApi.highlight_shape_regex(file_name, slide_index, shape_index, regex, highlight_color,
139
- 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)
140
145
  para = AsposeSlidesCloud::SpecUtils.testSlidesApi.get_paragraph(file_name, slide_index, shape_index, paragraph_index, password, folder_name)
141
146
  expect(para.portion_list[0].text).not_to eq(text_to_highlight)
142
147
  expect(para.portion_list[0].highlight_color).not_to eq(highlight_color)
143
148
  expect(para.portion_list[1].text).to eq(text_to_highlight)
144
149
  expect(para.portion_list[1].highlight_color).to eq(highlight_color)
145
- 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
146
194
  end
147
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" },
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.6.0
4
+ version: 24.8.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-06-25 00:00:00.000000000 Z
11
+ date: 2024-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -90,6 +90,26 @@ dependencies:
90
90
  - - ">="
91
91
  - !ruby/object:Gem::Version
92
92
  version: 2.1.0
93
+ - !ruby/object:Gem::Dependency
94
+ name: warning
95
+ requirement: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - "~>"
98
+ - !ruby/object:Gem::Version
99
+ version: '1.4'
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: 1.4.0
103
+ type: :runtime
104
+ prerelease: false
105
+ version_requirements: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - "~>"
108
+ - !ruby/object:Gem::Version
109
+ version: '1.4'
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ version: 1.4.0
93
113
  - !ruby/object:Gem::Dependency
94
114
  name: rspec
95
115
  requirement: !ruby/object:Gem::Requirement
@@ -268,6 +288,7 @@ files:
268
288
  - TestData/calibri.ttf
269
289
  - TestData/macros.pptm
270
290
  - TestData/oleObject.xlsx
291
+ - TestData/pictureFrame.html
271
292
  - TestData/shapes.svg
272
293
  - TestData/test-unprotected.pptx
273
294
  - TestData/test.pdf
@@ -423,6 +444,7 @@ files:
423
444
  - lib/aspose_slides_cloud/models/one_value_chart_data_point.rb
424
445
  - lib/aspose_slides_cloud/models/one_value_series.rb
425
446
  - lib/aspose_slides_cloud/models/operation.rb
447
+ - lib/aspose_slides_cloud/models/operation_error.rb
426
448
  - lib/aspose_slides_cloud/models/operation_progress.rb
427
449
  - lib/aspose_slides_cloud/models/ordered_merge_request.rb
428
450
  - lib/aspose_slides_cloud/models/outer_shadow_effect.rb