aspose_html_cloud 20.8.0 → 22.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aspose_html_cloud/api/html_api.rb +203 -2096
- data/lib/aspose_html_cloud/api/storage_api.rb +32 -332
- data/lib/aspose_html_cloud/api_client.rb +3 -3
- data/lib/aspose_html_cloud/api_error.rb +1 -1
- data/lib/aspose_html_cloud/configuration.rb +1 -1
- data/lib/aspose_html_cloud/models/base_model.rb +1 -1
- data/lib/aspose_html_cloud/models/conversion_result.rb +140 -0
- data/lib/aspose_html_cloud/models/disc_usage.rb +1 -1
- data/lib/aspose_html_cloud/models/error.rb +1 -1
- data/lib/aspose_html_cloud/models/error_details.rb +1 -1
- data/lib/aspose_html_cloud/models/file_version.rb +1 -1
- data/lib/aspose_html_cloud/models/file_versions.rb +1 -1
- data/lib/aspose_html_cloud/models/files_list.rb +1 -1
- data/lib/aspose_html_cloud/models/files_upload_result.rb +1 -1
- data/lib/aspose_html_cloud/models/object_exist.rb +1 -1
- data/lib/aspose_html_cloud/models/storage_exist.rb +1 -1
- data/lib/aspose_html_cloud/models/storage_file.rb +1 -1
- data/lib/aspose_html_cloud/version.rb +1 -1
- data/lib/aspose_html_cloud.rb +2 -1
- data/spec/api/html_api_spec.rb +221 -2285
- data/spec/api/model_spec.rb +1 -1
- data/spec/api/storage_api_spec.rb +5 -233
- data/spec/spec_helper.rb +7 -8
- metadata +19 -18
data/spec/api/model_spec.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
--------------------------------------------------------------------------------------------------------------------
|
4
4
|
<copyright company="Aspose" file="model_spec.rb">
|
5
5
|
</copyright>
|
6
|
-
Copyright (c)
|
6
|
+
Copyright (c) 2022 Aspose.HTML for Cloud
|
7
7
|
<summary>
|
8
8
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
9
9
|
of this software and associated documentation files (the "Software"), to deal
|
@@ -4,7 +4,7 @@
|
|
4
4
|
--------------------------------------------------------------------------------------------------------------------
|
5
5
|
<copyright company="Aspose" file="storage_api_spec.rb">
|
6
6
|
</copyright>
|
7
|
-
Copyright (c)
|
7
|
+
Copyright (c) 2022 Aspose.HTML for Cloud
|
8
8
|
<summary>
|
9
9
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
10
10
|
of this software and associated documentation files (the "Software"), to deal
|
@@ -112,43 +112,6 @@ describe 'Test Storage API' do
|
|
112
112
|
end
|
113
113
|
end
|
114
114
|
|
115
|
-
# Get file versions
|
116
|
-
# @param path File path e.g. '/file.ext'
|
117
|
-
# @param [Hash] opts the optional parameters
|
118
|
-
# @option opts [String] :storage_name Storage name
|
119
|
-
# @return [Array<(FileVersions, Fixnum, Hash)>] FileVersions data, response status code and response headers
|
120
|
-
describe 'get_file_versions test' do
|
121
|
-
it "must be {'value':[...]}" do
|
122
|
-
|
123
|
-
name = "test1.html"
|
124
|
-
|
125
|
-
# Upload file to server
|
126
|
-
res = upload_file_helper(name)
|
127
|
-
expect(res.uploaded.length).to eql(1)
|
128
|
-
expect(res.errors.length).to eql(0)
|
129
|
-
|
130
|
-
# Upload file to server
|
131
|
-
res = upload_file_helper(name)
|
132
|
-
expect(res.uploaded.length).to eql(1)
|
133
|
-
expect(res.errors.length).to eql(0)
|
134
|
-
|
135
|
-
# Upload file to server
|
136
|
-
res = upload_file_helper(name)
|
137
|
-
expect(res.uploaded.length).to eql(1)
|
138
|
-
expect(res.errors.length).to eql(0)
|
139
|
-
|
140
|
-
path = "HtmlTestDoc/" + name
|
141
|
-
opts = {storage_name: nil}
|
142
|
-
|
143
|
-
res = @api.get_file_versions(path, opts)
|
144
|
-
|
145
|
-
expect(res).to be_an_instance_of AsposeHtml::FileVersions
|
146
|
-
expect(res.value).to be_an_instance_of Array
|
147
|
-
expect(res.value[0]).to be_an_instance_of AsposeHtml::FileVersion
|
148
|
-
puts(res)
|
149
|
-
end
|
150
|
-
end
|
151
|
-
|
152
115
|
#################################################
|
153
116
|
# File API
|
154
117
|
#################################################
|
@@ -223,93 +186,10 @@ describe 'Test Storage API' do
|
|
223
186
|
end
|
224
187
|
end
|
225
188
|
|
226
|
-
# Copy file
|
227
|
-
# @param src_path Source file path e.g. '/folder/file.ext'
|
228
|
-
# @param dest_path Destination file path
|
229
|
-
# @param [Hash] opts the optional parameters
|
230
|
-
# @option opts [String] :src_storage_name Source storage name
|
231
|
-
# @option opts [String] :dest_storage_name Destination storage name
|
232
|
-
# @option opts [String] :version_id File version ID to copy
|
233
|
-
# @return nil
|
234
|
-
describe 'copy_file test' do
|
235
|
-
it "must be throw if error" do
|
236
|
-
name = "test_for_copy.html"
|
237
|
-
|
238
|
-
# Upload files to server
|
239
|
-
res = upload_file_helper(name)
|
240
|
-
expect(res.uploaded.length).to eql(1)
|
241
|
-
expect(res.errors.length).to eql(0)
|
242
|
-
|
243
|
-
src_path = "HtmlTestDoc/" + name
|
244
|
-
dest_path = "HtmlTestDoc/test_copied.html"
|
245
|
-
|
246
|
-
opts = {src_storage: nil, dest_storage: nil, version_id: nil}
|
247
|
-
|
248
|
-
@api.copy_file(src_path, dest_path, opts)
|
249
|
-
|
250
|
-
# Check result destination
|
251
|
-
res = @api.object_exists(dest_path)
|
252
|
-
expect(res).to be_an_instance_of AsposeHtml::ObjectExist
|
253
|
-
expect(res.exists).to be true
|
254
|
-
expect(res.is_folder).to be false
|
255
|
-
|
256
|
-
# Check result source
|
257
|
-
res = @api.object_exists(src_path)
|
258
|
-
expect(res).to be_an_instance_of AsposeHtml::ObjectExist
|
259
|
-
expect(res.exists).to be true
|
260
|
-
expect(res.is_folder).to be false
|
261
|
-
|
262
|
-
# Clear
|
263
|
-
@api.delete_file(src_path)
|
264
|
-
@api.delete_file(dest_path)
|
265
|
-
end
|
266
|
-
end
|
267
|
-
|
268
|
-
# unit tests for move_file
|
269
|
-
# Move a specific file
|
270
|
-
#
|
271
|
-
# @param src_path Source file path e.g. '/src.ext'
|
272
|
-
# @param dest_path Destination file path e.g. '/dest.ext'
|
273
|
-
# @param [Hash] opts the optional parameters
|
274
|
-
# @option opts [String] :src_storage_name Source storage name
|
275
|
-
# @option opts [String] :dest_storage_name Destination storage name
|
276
|
-
# @option opts [String] :version_id File version ID to move
|
277
|
-
# @return [nil]
|
278
|
-
describe 'move_file test' do
|
279
|
-
it "must be throw if error" do
|
280
|
-
name = "test_for_move.html"
|
281
|
-
|
282
|
-
# Upload files to server
|
283
|
-
res = upload_file_helper(name)
|
284
|
-
expect(res.uploaded.length).to eql(1)
|
285
|
-
expect(res.errors.length).to eql(0)
|
286
|
-
|
287
|
-
src_path = "HtmlTestDoc/" + name
|
288
|
-
dest_path = "HtmlTestDoc/test_moved.html"
|
289
|
-
|
290
|
-
opts = {src_storage: nil, dest_storage: nil, version_id: nil}
|
291
|
-
|
292
|
-
@api.move_file(src_path, dest_path, opts)
|
293
|
-
|
294
|
-
# Check result destination
|
295
|
-
res = @api.object_exists(dest_path)
|
296
|
-
expect(res).to be_an_instance_of AsposeHtml::ObjectExist
|
297
|
-
expect(res.exists).to be true
|
298
|
-
expect(res.is_folder).to be false
|
299
|
-
|
300
|
-
# Check result source
|
301
|
-
res = @api.object_exists(src_path)
|
302
|
-
expect(res).to be_an_instance_of AsposeHtml::ObjectExist
|
303
|
-
expect(res.exists).to be false
|
304
|
-
expect(res.is_folder).to be false
|
305
|
-
|
306
|
-
# Clear
|
307
|
-
@api.delete_file(dest_path)
|
308
|
-
end
|
309
|
-
end
|
310
|
-
|
311
189
|
# Upload file
|
312
|
-
# @param path Path where to upload including filename and extension e.g. /file.ext or /Folder 1/file.ext
|
190
|
+
# @param path Path where to upload including filename and extension e.g. /file.ext or /Folder 1/file.ext
|
191
|
+
# If the content is multipart and path does not contains the file name it tries to get them from filename parameter
|
192
|
+
# from Content-Disposition header.
|
313
193
|
# @param file File to upload
|
314
194
|
# @param [Hash] opts the optional parameters
|
315
195
|
# @option opts [String] :storage_name Storage name
|
@@ -318,7 +198,7 @@ describe 'Test Storage API' do
|
|
318
198
|
it "must be FilesUploadResult" do
|
319
199
|
name = "test_upload_file.html"
|
320
200
|
|
321
|
-
path = "HtmlTestDoc
|
201
|
+
path = "HtmlTestDoc"
|
322
202
|
file = File.realpath(__dir__ + '/../../testdata/' + name)
|
323
203
|
|
324
204
|
opts = {storage_name: nil, version_id: nil}
|
@@ -378,114 +258,6 @@ describe 'Test Storage API' do
|
|
378
258
|
end
|
379
259
|
end
|
380
260
|
|
381
|
-
# Copy folder
|
382
|
-
# @param src_path Source folder path e.g. '/src'
|
383
|
-
# @param dest_path Destination folder path e.g. '/dst'
|
384
|
-
# @param [Hash] opts the optional parameters
|
385
|
-
# @option opts [String] :src_storage_name Source storage name
|
386
|
-
# @option opts [String] :dest_storage_name Destination storage name
|
387
|
-
# @return [nil]
|
388
|
-
describe 'copy_folder test' do
|
389
|
-
it "must be throw if error" do
|
390
|
-
|
391
|
-
src_path = "HtmlTestDoc/testSourceFolder"
|
392
|
-
opts_exist = {storage_name: nil, version_id: nil}
|
393
|
-
|
394
|
-
# Check before
|
395
|
-
res = @api.object_exists(src_path, opts_exist)
|
396
|
-
expect(res).to be_an_instance_of AsposeHtml::ObjectExist
|
397
|
-
expect(res.exists).to be false
|
398
|
-
expect(res.is_folder).to be false
|
399
|
-
|
400
|
-
# create folder
|
401
|
-
opts_folder = {storage_name: nil}
|
402
|
-
@api.create_folder(src_path, opts_folder)
|
403
|
-
|
404
|
-
# Check creating
|
405
|
-
res = @api.object_exists(src_path, opts_exist)
|
406
|
-
expect(res).to be_an_instance_of AsposeHtml::ObjectExist
|
407
|
-
expect(res.exists).to be true
|
408
|
-
expect(res.is_folder).to be true
|
409
|
-
|
410
|
-
# Test copy folder
|
411
|
-
dest_path = "HtmlTestDoc/CopiedFolder"
|
412
|
-
opts_copy = {src_storage_name: nil, dest_storage_name: nil}
|
413
|
-
|
414
|
-
@api.copy_folder(src_path, dest_path, opts_copy)
|
415
|
-
|
416
|
-
# Check src after copy
|
417
|
-
res = @api.object_exists(src_path, opts_exist)
|
418
|
-
expect(res).to be_an_instance_of AsposeHtml::ObjectExist
|
419
|
-
expect(res.exists).to be true
|
420
|
-
expect(res.is_folder).to be true
|
421
|
-
|
422
|
-
# Check dst after copy
|
423
|
-
res = @api.object_exists(dest_path, opts_exist)
|
424
|
-
expect(res).to be_an_instance_of AsposeHtml::ObjectExist
|
425
|
-
expect(res.exists).to be true
|
426
|
-
expect(res.is_folder).to be true
|
427
|
-
|
428
|
-
# Clear test folder
|
429
|
-
opts_delete = {storage_name: nil, recursive: true}
|
430
|
-
@api.delete_folder(src_path, opts_delete)
|
431
|
-
@api.delete_folder(dest_path, opts_delete)
|
432
|
-
end
|
433
|
-
end
|
434
|
-
|
435
|
-
# Move folder
|
436
|
-
# @param src_path Folder path to move e.g. '/folder'
|
437
|
-
# @param dest_path Destination folder path to move to e.g '/dst'
|
438
|
-
# @param [Hash] opts the optional parameters
|
439
|
-
# @option opts [String] :src_storage_name Source storage name
|
440
|
-
# @option opts [String] :dest_storage_name Destination storage name
|
441
|
-
# @return [nil]
|
442
|
-
describe 'move_folder test' do
|
443
|
-
it "must be throw if error" do
|
444
|
-
|
445
|
-
src_path = "HtmlTestDoc/testSourceFolder"
|
446
|
-
opts_exist = {storage_name: nil, version_id: nil}
|
447
|
-
|
448
|
-
# Check before
|
449
|
-
res = @api.object_exists(src_path, opts_exist)
|
450
|
-
expect(res).to be_an_instance_of AsposeHtml::ObjectExist
|
451
|
-
expect(res.exists).to be false
|
452
|
-
expect(res.is_folder).to be false
|
453
|
-
|
454
|
-
# create folder
|
455
|
-
opts_folder = {storage_name: nil}
|
456
|
-
@api.create_folder(src_path, opts_folder)
|
457
|
-
|
458
|
-
# Check creating
|
459
|
-
res = @api.object_exists(src_path, opts_exist)
|
460
|
-
expect(res).to be_an_instance_of AsposeHtml::ObjectExist
|
461
|
-
expect(res.exists).to be true
|
462
|
-
expect(res.is_folder).to be true
|
463
|
-
|
464
|
-
# Test move folder
|
465
|
-
dest_path = "HtmlTestDoc/MovedFolder"
|
466
|
-
opts_copy = {src_storage_name: nil, dest_storage_name: nil}
|
467
|
-
|
468
|
-
@api.move_folder(src_path, dest_path, opts_copy)
|
469
|
-
|
470
|
-
# Check src after copy
|
471
|
-
res = @api.object_exists(src_path, opts_exist)
|
472
|
-
expect(res).to be_an_instance_of AsposeHtml::ObjectExist
|
473
|
-
expect(res.exists).to be false
|
474
|
-
expect(res.is_folder).to be false
|
475
|
-
|
476
|
-
# Check dst after copy
|
477
|
-
res = @api.object_exists(dest_path, opts_exist)
|
478
|
-
expect(res).to be_an_instance_of AsposeHtml::ObjectExist
|
479
|
-
expect(res.exists).to be true
|
480
|
-
expect(res.is_folder).to be true
|
481
|
-
|
482
|
-
# Clear test folder
|
483
|
-
opts_delete = {storage_name: nil, recursive: true}
|
484
|
-
@api.delete_folder(src_path, opts_delete)
|
485
|
-
@api.delete_folder(dest_path, opts_delete)
|
486
|
-
end
|
487
|
-
end
|
488
|
-
|
489
261
|
# Delete folder
|
490
262
|
# @param path Folder path e.g. '/folder'
|
491
263
|
# @param [Hash] opts the optional parameters
|
data/spec/spec_helper.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
--------------------------------------------------------------------------------------------------------------------
|
4
4
|
<copyright company="Aspose" file="spec_helper.rb">
|
5
5
|
</copyright>
|
6
|
-
Copyright (c)
|
6
|
+
Copyright (c) 2022 Aspose.HTML for Cloud
|
7
7
|
<summary>
|
8
8
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
9
9
|
of this software and associated documentation files (the "Software"), to deal
|
@@ -30,11 +30,11 @@
|
|
30
30
|
require 'aspose_html_cloud'
|
31
31
|
|
32
32
|
CONFIG = {
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
33
|
+
"basePath": "https://api.aspose.cloud/v4.0",
|
34
|
+
"authPath": "https://api.aspose.cloud/connect/token",
|
35
|
+
"apiKey": "c8dda7d6445d82635b8797d1c8edd153",
|
36
|
+
"appSID": "2225baa2-097b-4731-9831-d0d56c28230f",
|
37
|
+
"debug": true
|
38
38
|
}
|
39
39
|
# from storage api
|
40
40
|
Storage_api = AsposeHtml::StorageApi.new CONFIG
|
@@ -42,9 +42,8 @@ Storage_api = AsposeHtml::StorageApi.new CONFIG
|
|
42
42
|
# Helper methods
|
43
43
|
def upload_file_helper(file_name, upload_folder = nil)
|
44
44
|
folder = upload_folder.nil? ? "HtmlTestDoc" : upload_folder
|
45
|
-
path = folder + '/' + file_name
|
46
45
|
file = File.realpath(__dir__ + '/../testdata/' + file_name)
|
47
|
-
Storage_api.upload_file(
|
46
|
+
Storage_api.upload_file(folder, file)
|
48
47
|
end
|
49
48
|
|
50
49
|
def download_file_helper(file_name, download_folder = nil)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aspose_html_cloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 22.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Makogon
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-10-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -34,42 +34,42 @@ dependencies:
|
|
34
34
|
name: json
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
|
-
- - ">="
|
38
|
-
- !ruby/object:Gem::Version
|
39
|
-
version: 2.1.0
|
40
37
|
- - "~>"
|
41
38
|
- !ruby/object:Gem::Version
|
42
39
|
version: '2.1'
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 2.1.0
|
43
43
|
type: :runtime
|
44
44
|
prerelease: false
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
|
-
- - ">="
|
48
|
-
- !ruby/object:Gem::Version
|
49
|
-
version: 2.1.0
|
50
47
|
- - "~>"
|
51
48
|
- !ruby/object:Gem::Version
|
52
49
|
version: '2.1'
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: 2.1.0
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
54
|
name: rspec
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|
56
56
|
requirements:
|
57
|
-
- - ">="
|
58
|
-
- !ruby/object:Gem::Version
|
59
|
-
version: 3.6.0
|
60
57
|
- - "~>"
|
61
58
|
- !ruby/object:Gem::Version
|
62
59
|
version: '3.6'
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: 3.6.0
|
63
63
|
type: :development
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
|
-
- - ">="
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: 3.6.0
|
70
67
|
- - "~>"
|
71
68
|
- !ruby/object:Gem::Version
|
72
69
|
version: '3.6'
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: 3.6.0
|
73
73
|
- !ruby/object:Gem::Dependency
|
74
74
|
name: vcr
|
75
75
|
requirement: !ruby/object:Gem::Requirement
|
@@ -203,6 +203,7 @@ files:
|
|
203
203
|
- lib/aspose_html_cloud/api_error.rb
|
204
204
|
- lib/aspose_html_cloud/configuration.rb
|
205
205
|
- lib/aspose_html_cloud/models/base_model.rb
|
206
|
+
- lib/aspose_html_cloud/models/conversion_result.rb
|
206
207
|
- lib/aspose_html_cloud/models/disc_usage.rb
|
207
208
|
- lib/aspose_html_cloud/models/error.rb
|
208
209
|
- lib/aspose_html_cloud/models/error_details.rb
|
@@ -222,7 +223,7 @@ homepage: https://github.com/aspose-html-cloud/aspose-html-cloud-ruby
|
|
222
223
|
licenses:
|
223
224
|
- MIT
|
224
225
|
metadata: {}
|
225
|
-
post_install_message:
|
226
|
+
post_install_message:
|
226
227
|
rdoc_options: []
|
227
228
|
require_paths:
|
228
229
|
- lib
|
@@ -237,8 +238,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
237
238
|
- !ruby/object:Gem::Version
|
238
239
|
version: '0'
|
239
240
|
requirements: []
|
240
|
-
rubygems_version: 3.
|
241
|
-
signing_key:
|
241
|
+
rubygems_version: 3.3.7
|
242
|
+
signing_key:
|
242
243
|
specification_version: 4
|
243
244
|
summary: A ruby wrapper for the Aspose.HTML Cloud SDK API.
|
244
245
|
test_files:
|