aspose_slides_cloud 23.9.0 → 23.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -7
  3. data/README.md +4 -0
  4. data/aspose_slides_cloud.gemspec +0 -1
  5. data/docker-entrypoint.sh +1 -0
  6. data/lib/aspose_slides_cloud/api/slides_async_api.rb +273 -0
  7. data/lib/aspose_slides_cloud/api_client.rb +2 -1
  8. data/lib/aspose_slides_cloud/models/operation.rb +209 -0
  9. data/lib/aspose_slides_cloud/type_registry.rb +1 -0
  10. data/lib/aspose_slides_cloud/version.rb +1 -1
  11. data/lib/aspose_slides_cloud.rb +2 -0
  12. data/spec/api/slides_api_spec.rb +2016 -2016
  13. data/spec/api/slides_async_api_spec.rb +554 -0
  14. data/spec/spec_utils.rb +38 -7
  15. data/spec/use_cases/abstract_class_spec.rb +1 -1
  16. data/spec/use_cases/animation_spec.rb +28 -28
  17. data/spec/use_cases/async_api_spec.rb +82 -0
  18. data/spec/use_cases/chart_spec.rb +51 -51
  19. data/spec/use_cases/comment_spec.rb +17 -17
  20. data/spec/use_cases/create_spec.rb +22 -22
  21. data/spec/use_cases/font_spec.rb +24 -24
  22. data/spec/use_cases/header_footer_spec.rb +9 -9
  23. data/spec/use_cases/hyperlink_spec.rb +10 -10
  24. data/spec/use_cases/image_spec.rb +16 -16
  25. data/spec/use_cases/layout_slide_spec.rb +41 -41
  26. data/spec/use_cases/master_slide_spec.rb +40 -40
  27. data/spec/use_cases/math_spec.rb +15 -15
  28. data/spec/use_cases/merge_spec.rb +15 -15
  29. data/spec/use_cases/notes_slide_spec.rb +39 -39
  30. data/spec/use_cases/nullable_field_spec.rb +7 -7
  31. data/spec/use_cases/paragraph_spec.rb +38 -38
  32. data/spec/use_cases/pipeline_spec.rb +1 -1
  33. data/spec/use_cases/portion_spec.rb +34 -34
  34. data/spec/use_cases/property_spec.rb +38 -38
  35. data/spec/use_cases/section_spec.rb +16 -16
  36. data/spec/use_cases/shape_format_spec.rb +12 -12
  37. data/spec/use_cases/shape_spec.rb +87 -87
  38. data/spec/use_cases/slide_spec.rb +32 -32
  39. data/spec/use_cases/split_spec.rb +12 -12
  40. data/spec/use_cases/table_spec.rb +38 -38
  41. data/spec/use_cases/text_format_spec.rb +4 -4
  42. data/spec/use_cases/text_spec.rb +28 -28
  43. data/spec/use_cases/vba_spec.rb +10 -10
  44. data/spec/use_cases/watermark_spec.rb +36 -36
  45. data/testConfig.json +2 -1
  46. data/testRules.json +7 -0
  47. metadata +8 -24
  48. data/spec/use_cases/convert_spec.rb +0 -199
@@ -1,199 +0,0 @@
1
- =begin
2
- Copyright (c) 2019 Aspose Pty Ltd
3
-
4
- Permission is hereby granted, free of charge, to any person obtaining a copy
5
- of this software and associated documentation files (the "Software"), to deal
6
- in the Software without restriction, including without limitation the rights
7
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- copies of the Software, and to permit persons to whom the Software is
9
- furnished to do so, subject to the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be included in all
12
- copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- SOFTWARE.
21
- =end
22
-
23
- require 'spec_helper'
24
-
25
- describe 'UseCases' do
26
- describe 'Convert' do
27
- it 'post from request' do
28
- source = File.binread("TestData/test.pptx")
29
- result = AsposeSlidesCloud::SpecUtils.api.convert(source, AsposeSlidesCloud::ExportFormat::PDF, "password")
30
- result_slides = AsposeSlidesCloud::SpecUtils.api.convert(source, AsposeSlidesCloud::ExportFormat::PDF, "password", nil, nil, [ 2, 4 ])
31
- expect(result_slides.size).to be < result.size
32
- end
33
-
34
- it 'put from request' do
35
- out_path = "TestData/test.pdf"
36
- source = File.binread("TestData/test.pptx")
37
- AsposeSlidesCloud::SpecUtils.api.convert_and_save(source, AsposeSlidesCloud::ExportFormat::PDF, out_path, "password")
38
- expect(AsposeSlidesCloud::SpecUtils.api.object_exists(out_path).exists).to be true
39
- end
40
-
41
- it 'post from storage' do
42
- folder_name = "TempSlidesSDK"
43
- file_name = "test.pdf"
44
- AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
45
- AsposeSlidesCloud::SpecUtils.api.download_presentation(file_name, AsposeSlidesCloud::ExportFormat::HTML5, nil, "password", folder_name)
46
- end
47
-
48
- it 'put from storage' do
49
- folder_name = "TempSlidesSDK"
50
- file_name = "test.pptx"
51
- out_path = "TestData/test.pdf"
52
- AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
53
- AsposeSlidesCloud::SpecUtils.api.save_presentation(file_name, AsposeSlidesCloud::ExportFormat::PDF, out_path, nil, "password", folder_name)
54
- expect(AsposeSlidesCloud::SpecUtils.api.object_exists(out_path).exists).to be true
55
- end
56
-
57
- it 'with options from request' do
58
- source = File.binread("TestData/test.pptx")
59
- result = AsposeSlidesCloud::SpecUtils.api.convert(source, AsposeSlidesCloud::ExportFormat::PDF, "password")
60
- options = AsposeSlidesCloud::PdfExportOptions.new
61
- options.draw_slides_frame = true
62
- result_with_options = AsposeSlidesCloud::SpecUtils.api.convert(source, AsposeSlidesCloud::ExportFormat::PDF, "password", nil, nil, nil, options)
63
- expect(result_with_options.size).not_to eq(result.size)
64
- end
65
-
66
- it 'with options from storage' do
67
- folder_name = "TempSlidesSDK"
68
- file_name = "test.pptx"
69
- AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
70
- result = AsposeSlidesCloud::SpecUtils.api.download_presentation(file_name, AsposeSlidesCloud::ExportFormat::PNG, nil, "password", folder_name)
71
- options = AsposeSlidesCloud::ImageExportOptions.new
72
- options.width = 480
73
- options.height = 360
74
- result_with_options = AsposeSlidesCloud::SpecUtils.api.download_presentation(file_name, AsposeSlidesCloud::ExportFormat::PNG, options, "password", folder_name)
75
- expect(result_with_options.size).to be < result.size
76
- end
77
-
78
- it 'slide post from request' do
79
- source = File.binread("TestData/test.pptx")
80
- result = AsposeSlidesCloud::SpecUtils.api.download_slide_online(source, 1, AsposeSlidesCloud::SlideExportFormat::PDF, nil, nil, "password")
81
- end
82
-
83
- it 'slide put from request' do
84
- out_path = "TestData/test.pdf"
85
- source = File.binread("TestData/test.pptx")
86
- AsposeSlidesCloud::SpecUtils.api.save_slide_online(source, 1, AsposeSlidesCloud::SlideExportFormat::PDF, out_path, nil, nil, "password")
87
- expect(AsposeSlidesCloud::SpecUtils.api.object_exists(out_path).exists).to be true
88
- end
89
-
90
- it 'slide post from storage' do
91
- folder_name = "TempSlidesSDK"
92
- file_name = "test.pdf"
93
- AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
94
- AsposeSlidesCloud::SpecUtils.api.download_slide(file_name, 1, AsposeSlidesCloud::SlideExportFormat::PDF, nil, nil, nil, "password", folder_name)
95
- end
96
-
97
- it 'slide put from storage' do
98
- folder_name = "TempSlidesSDK"
99
- file_name = "test.pptx"
100
- out_path = "TestData/test.pdf"
101
- AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
102
- AsposeSlidesCloud::SpecUtils.api.save_slide(file_name, 1, AsposeSlidesCloud::SlideExportFormat::PDF, out_path, nil, nil, nil, "password", folder_name)
103
- expect(AsposeSlidesCloud::SpecUtils.api.object_exists(out_path).exists).to be true
104
- end
105
-
106
- it 'slide with options from request' do
107
- source = File.binread("TestData/test.pptx")
108
- result = AsposeSlidesCloud::SpecUtils.api.download_slide_online(source, 1, AsposeSlidesCloud::SlideExportFormat::PDF, nil, nil, "password")
109
- options = AsposeSlidesCloud::PdfExportOptions.new
110
- options.draw_slides_frame = true
111
- result_with_options = AsposeSlidesCloud::SpecUtils.api.download_slide_online(source, 1, AsposeSlidesCloud::SlideExportFormat::PDF, nil, nil, "password", nil, nil, options)
112
- expect(result_with_options.size).not_to eq(result.size)
113
- end
114
-
115
- it 'slide with options from storage' do
116
- folder_name = "TempSlidesSDK"
117
- file_name = "test.pptx"
118
- AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
119
- result = AsposeSlidesCloud::SpecUtils.api.download_slide(file_name, 1, AsposeSlidesCloud::SlideExportFormat::PDF, nil, nil, nil, "password", folder_name)
120
- options = AsposeSlidesCloud::PdfExportOptions.new
121
- options.draw_slides_frame = true
122
- result_with_options = AsposeSlidesCloud::SpecUtils.api.download_slide(file_name, 1, AsposeSlidesCloud::SlideExportFormat::PDF, options, nil, nil, "password", folder_name)
123
- expect(result_with_options.size).not_to eq(result.size)
124
- end
125
-
126
- it 'shape post from request' do
127
- source = File.binread("TestData/test.pptx")
128
- result = AsposeSlidesCloud::SpecUtils.api.download_shape_online(source, 1, 3, AsposeSlidesCloud::ShapeExportFormat::PNG, nil, nil, nil, "password")
129
- end
130
-
131
- it 'shape put from request' do
132
- out_path = "TestData/test.pdf"
133
- source = File.binread("TestData/test.pptx")
134
- AsposeSlidesCloud::SpecUtils.api.save_shape_online(source, 1, 1, AsposeSlidesCloud::ShapeExportFormat::PNG, out_path, nil, nil, nil, "password")
135
- expect(AsposeSlidesCloud::SpecUtils.api.object_exists(out_path).exists).to be true
136
- end
137
-
138
- it 'shape post from storage' do
139
- folder_name = "TempSlidesSDK"
140
- file_name = "test.pdf"
141
- AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
142
- AsposeSlidesCloud::SpecUtils.api.download_shape(file_name, 1, 1, AsposeSlidesCloud::ShapeExportFormat::PNG, nil, nil, nil, nil, "password", folder_name)
143
- end
144
-
145
- it 'subshape post from storage' do
146
- folder_name = "TempSlidesSDK"
147
- file_name = "test.pptx"
148
- shape_index = 4
149
- sub_shape = "1"
150
- AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
151
- response = AsposeSlidesCloud::SpecUtils.api.download_shape(file_name, 1, shape_index, AsposeSlidesCloud::ShapeExportFormat::PNG,
152
- nil, nil, nil, nil, "password", folder_name, "", sub_shape)
153
- expect(response.size).not_to eq(0)
154
- end
155
-
156
- it 'shape put from storage' do
157
- folder_name = "TempSlidesSDK"
158
- file_name = "test.pptx"
159
- out_path = "TestData/test.pdf"
160
- AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
161
- AsposeSlidesCloud::SpecUtils.api.save_shape(file_name, 1, 1, AsposeSlidesCloud::ShapeExportFormat::PNG, out_path, nil, nil, nil, nil, "password", folder_name)
162
- expect(AsposeSlidesCloud::SpecUtils.api.object_exists(out_path).exists).to be true
163
- end
164
-
165
- it 'subshape put from storage' do
166
- folder_name = "TempSlidesSDK"
167
- file_name = "test.pptx"
168
- out_path = "TestData/test.png"
169
- shape_index = 4
170
- sub_shape = "1"
171
- AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
172
- AsposeSlidesCloud::SpecUtils.api.save_shape(file_name, 1, shape_index, AsposeSlidesCloud::ShapeExportFormat::PNG,
173
- out_path, nil, nil, nil, nil, "password", folder_name, "", sub_shape)
174
- expect(AsposeSlidesCloud::SpecUtils.api.object_exists(out_path).exists).to be true
175
- end
176
-
177
- it "font fallback rules" do
178
- font_rule1 = AsposeSlidesCloud::FontFallbackRule.new
179
- font_rule1.range_start_index = 0x0B80
180
- font_rule1.range_end_index = 0x0BFF
181
- font_rule1.fallback_font_list = ["Vijaya"]
182
-
183
- font_rule2 = AsposeSlidesCloud::FontFallbackRule.new
184
- font_rule2.range_start_index = 0x0B80
185
- font_rule2.range_end_index = 0x0BFF
186
- font_rule2.fallback_font_list = ["Segoe UI Emoji", "Segoe UI Symbol", "Arial"]
187
-
188
- font_rules = [font_rule1, font_rule2]
189
- export_options = AsposeSlidesCloud::ImageExportOptions.new
190
- export_options.font_fallback_rules = font_rules
191
-
192
- folder_name = "TempSlidesSDK"
193
- file_name = "test.pptx"
194
- AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
195
- response = AsposeSlidesCloud::SpecUtils.api.download_presentation(file_name, "PNG", export_options, "password", folder_name)
196
- expect(response.size).not_to eq(0)
197
- end
198
- end
199
- end