asposecloud 1.0.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +31 -9
- data/Tests/Barcode/builder_tests.rb +95 -0
- data/Tests/Barcode/reader_tests.rb +70 -0
- data/Tests/Cells/charteditor_tests.rb +139 -0
- data/Tests/Cells/converter_tests.rb +83 -0
- data/Tests/Cells/extractor_tests.rb +40 -0
- data/Tests/Cells/texteditor_tests.rb +52 -0
- data/Tests/Cells/workbook_tests.rb +167 -0
- data/Tests/Cells/worksheet_tests.rb +435 -0
- data/Tests/Data/barcodeQR.bmp +0 -0
- data/Tests/Data/barcodeQR.jpg +0 -0
- data/Tests/Data/barcodeQR.tiff +0 -0
- data/Tests/Data/bizcard.psd +0 -0
- data/Tests/Data/macbook.gif +0 -0
- data/Tests/Data/mail_merge_regions.docx +0 -0
- data/Tests/Data/mail_merge_template.docx +0 -0
- data/Tests/Data/test_cells.xlsx +0 -0
- data/Tests/Data/test_multi_pages.docx +0 -0
- data/Tests/Data/test_slides.pptx +0 -0
- data/Tests/Email/converter_tests.rb +30 -0
- data/Tests/Email/document_tests.rb +55 -0
- data/Tests/Imaging/converter_tests.rb +32 -0
- data/Tests/Imaging/document_tests.rb +132 -0
- data/Tests/Imaging/extractor_tests.rb +67 -0
- data/Tests/Imaging/image_tests.rb +55 -0
- data/Tests/Ocr/extractor_tests.rb +34 -0
- data/Tests/Pdf/annotationeditor_tests.rb +128 -0
- data/Tests/Pdf/converter_tests.rb +74 -0
- data/Tests/Pdf/document_tests.rb +285 -0
- data/Tests/Pdf/extractor_tests.rb +37 -0
- data/Tests/Pdf/texteditor_tests.rb +84 -0
- data/Tests/Slides/converter_tests.rb +59 -0
- data/Tests/Slides/document_tests.rb +187 -0
- data/Tests/Slides/extractor_tests.rb +92 -0
- data/Tests/Storage/folder_tests.rb +64 -0
- data/Tests/Tasks/assignments_tests.rb +44 -0
- data/Tests/Tasks/calendar_tests.rb +45 -0
- data/Tests/Tasks/converter_tests.rb +32 -0
- data/Tests/Tasks/document_tests.rb +114 -0
- data/Tests/Tasks/resources_tests.rb +44 -0
- data/Tests/Words/builder_tests.rb +56 -0
- data/Tests/Words/converter_tests.rb +54 -0
- data/Tests/Words/document_tests.rb +208 -0
- data/Tests/Words/extractor_tests.rb +120 -0
- data/Tests/Words/mail_merge_tests.rb +120 -0
- data/Tests/setup.json +6 -0
- data/lib/Barcode/builder.rb +270 -20
- data/lib/Barcode/reader.rb +112 -18
- data/lib/Cells/chart_editor.rb +102 -0
- data/lib/Cells/convertor.rb +22 -2
- data/lib/Cells/text_editor.rb +8 -2
- data/lib/Cells/workbook.rb +63 -3
- data/lib/Cells/worksheet.rb +479 -10
- data/lib/Common/utils.rb +2 -0
- data/lib/Email/converter.rb +2 -18
- data/lib/Email/document.rb +32 -17
- data/lib/Ocr/extractor.rb +26 -20
- data/lib/Pdf/annotation_editor.rb +0 -17
- data/lib/Pdf/converter.rb +25 -17
- data/lib/Pdf/document.rb +167 -23
- data/lib/Pdf/extractor.rb +0 -17
- data/lib/Pdf/text_editor.rb +35 -20
- data/lib/Slides/converter.rb +48 -18
- data/lib/Slides/document.rb +186 -51
- data/lib/Slides/extractor.rb +35 -18
- data/lib/Storage/folder.rb +30 -25
- data/lib/Words/builder.rb +23 -29
- data/lib/Words/converter.rb +30 -17
- data/lib/Words/document.rb +336 -28
- data/lib/Words/extractor.rb +112 -33
- data/lib/Words/mail_merge.rb +2 -20
- data/{Tests/word_tests.rb → lib/aspose_imaging.rb} +5 -17
- data/lib/asposecloud.rb +3 -1
- data/lib/asposecloud/version.rb +1 -1
- data/lib/imaging/converter.rb +55 -0
- data/lib/imaging/document.rb +301 -0
- data/lib/imaging/extractor.rb +165 -0
- data/lib/imaging/image.rb +118 -0
- data/lib/restclient.rb +36 -0
- data/lib/tasks/assignments.rb +19 -19
- data/lib/tasks/calendar.rb +27 -19
- data/lib/tasks/converter.rb +4 -17
- data/lib/tasks/document.rb +79 -22
- data/lib/tasks/resources.rb +18 -18
- metadata +70 -19
- checksums.yaml +0 -7
- data/Tests/barcode_tests.rb +0 -45
- data/Tests/cell_tests.rb +0 -41
- data/Tests/email_tests.rb +0 -43
- data/Tests/pdf_tests.rb +0 -76
- data/Tests/slide_tests.rb +0 -41
- data/Tests/storage_tests.rb +0 -86
- data/Tests/tasks_tests.rb +0 -24
data/README.md
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
[](http://badge.fury.io/rb/asposecloud)
|
1
2
|
#Aspose Cloud SDK for Ruby Repository
|
2
3
|
|
3
4
|
This repository contains Aspose Cloud SDK for Ruby source code. This SDK allows you to work with Aspose REST API in your Ruby applications quickly and easily.
|
@@ -25,29 +26,48 @@ This repository contains Aspose Cloud SDK for Ruby source code. This SDK allows
|
|
25
26
|
|
26
27
|
<tr>
|
27
28
|
<td>Pdf</td>
|
28
|
-
<td>This module provides the features to manipulate PDF
|
29
|
+
<td>This module provides the features to manipulate PDF file formats using Aspose.Pdf for Cloud.</td>
|
29
30
|
</tr>
|
30
31
|
|
31
32
|
<tr>
|
32
33
|
<td>Words</td>
|
33
|
-
<td>This module provides the features to manipulate
|
34
|
+
<td>This module provides the features to manipulate word processing file formats using Aspose.Words for Cloud.</td>
|
34
35
|
</tr>
|
35
36
|
|
36
37
|
<tr>
|
37
38
|
<td>Cells</td>
|
38
|
-
<td>This module provides the features to manipulate
|
39
|
+
<td>This module provides the features to manipulate spreadsheet file formats using Aspose.Cloud for Cloud.</td>
|
39
40
|
</tr>
|
40
41
|
|
41
42
|
<tr>
|
42
43
|
<td>Slides</td>
|
43
|
-
<td>This module provides the features to manipulate
|
44
|
+
<td>This module provides the features to manipulate presentations file formats using Aspose.Slides for Cloud.</td>
|
44
45
|
</tr>
|
45
46
|
|
46
47
|
<tr>
|
47
48
|
<td>BarCode</td>
|
48
|
-
<td>This module provides the features to
|
49
|
+
<td>This module provides the features to create and detect BarCodes images using Aspose.BarCode for Cloud.</td>
|
49
50
|
</tr>
|
50
51
|
|
52
|
+
<tr>
|
53
|
+
<td>Email</td>
|
54
|
+
<td>This module provides the features to manipulate email file formats using Aspose.Email for Cloud.</td>
|
55
|
+
</tr>
|
56
|
+
|
57
|
+
<tr>
|
58
|
+
<td>OCR</td>
|
59
|
+
<td>This module provides the features to detect text from images using Aspose.OCR for Cloud.</td>
|
60
|
+
</tr>
|
61
|
+
|
62
|
+
<tr>
|
63
|
+
<td>Imaging</td>
|
64
|
+
<td>This module provides the features to process image file formats using Aspose.Imaging for Cloud.</td>
|
65
|
+
</tr>
|
66
|
+
|
67
|
+
<tr>
|
68
|
+
<td>Tasks</td>
|
69
|
+
<td>This module provides the features to process Microsoft Project file formats using Aspose.Tasks for Cloud.</td>
|
70
|
+
</tr>
|
51
71
|
|
52
72
|
</table>
|
53
73
|
|
@@ -62,10 +82,12 @@ In order to manipulate any files, you first need to upload them to the Aspose st
|
|
62
82
|
The Aspose Cloud SDK for Ruby allows you to save the output files at your specified location.
|
63
83
|
|
64
84
|
|
65
|
-
###
|
85
|
+
###Docs
|
66
86
|
|
67
|
-
|
87
|
+
For SDK API Ref Docs, please go through [API Docs](http://asposeforcloud.github.io/ruby-sdk-docs/).
|
88
|
+
For SDK Usage Examples, please go through [wiki](https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_Ruby/wiki).
|
89
|
+
For Aspose Cloud APIs related help, please go through [Aspose.Total for Cloud](http://www.aspose.com/cloud/total-api.aspx).
|
68
90
|
|
69
|
-
##
|
91
|
+
##Start a Free Trial Today
|
70
92
|
|
71
|
-
|
93
|
+
Start a free trial today – all you need is to [sign up](https://cloud.aspose.com/SignUp) with Aspose for Cloud service. Once you have signed up, you are ready to try powerful file processing features offered by Aspose for Cloud.
|
@@ -0,0 +1,95 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require_relative '../../lib/asposecloud'
|
3
|
+
|
4
|
+
class BuilderTests < Test::Unit::TestCase
|
5
|
+
|
6
|
+
def setup
|
7
|
+
file = File.read('../setup.json')
|
8
|
+
data = JSON.parse(file)
|
9
|
+
|
10
|
+
Aspose::Cloud::Common::AsposeApp.app_key = data['app_key']
|
11
|
+
Aspose::Cloud::Common::AsposeApp.app_sid = data['app_sid']
|
12
|
+
Aspose::Cloud::Common::AsposeApp.output_location = data['output_location']
|
13
|
+
Aspose::Cloud::Common::Product.set_base_product_uri(data['product_uri'])
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_save
|
17
|
+
builder = Aspose::Cloud::Barcode::Builder.new
|
18
|
+
assert_nothing_thrown 'Error' do
|
19
|
+
builder.save(code_text='Text to generate barcode', symbology='QR', image_format='png')
|
20
|
+
end
|
21
|
+
assert_equal true, File.exist?('../Output/barcodeQR.png')
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_generate_barcode_image_stream
|
25
|
+
builder = Aspose::Cloud::Barcode::Builder.new
|
26
|
+
assert_nothing_thrown 'Error' do
|
27
|
+
response = builder.generate_barcode_image_stream(code_text='Text to generate barcode', symbology='QR', image_format='png')
|
28
|
+
end
|
29
|
+
assert_equal true, response.to_s
|
30
|
+
end
|
31
|
+
|
32
|
+
def test_set_barcode_code_location
|
33
|
+
builder = Aspose::Cloud::Barcode::Builder.new
|
34
|
+
assert_nothing_thrown 'Error' do
|
35
|
+
builder.set_barcode_code_location(code_text='Text to generate barcode', code_location='Above', symbology='QR', image_format='png')
|
36
|
+
end
|
37
|
+
assert_equal true, File.exist?('../Output/barcodeQR.png')
|
38
|
+
end
|
39
|
+
|
40
|
+
def test_set_barcode_checksum
|
41
|
+
builder = Aspose::Cloud::Barcode::Builder.new
|
42
|
+
assert_nothing_thrown 'Error' do
|
43
|
+
builder.set_barcode_checksum(code_text='Text to generate barcode', checksum='Default', symbology='QR', image_format='png')
|
44
|
+
end
|
45
|
+
assert_equal true, File.exist?('../Output/barcodeQR.png')
|
46
|
+
end
|
47
|
+
|
48
|
+
def test_set_barcode_height_width
|
49
|
+
builder = Aspose::Cloud::Barcode::Builder.new
|
50
|
+
assert_nothing_thrown 'Error' do
|
51
|
+
builder.set_barcode_height_width(code_text='Text to generate barcode', height=40, width=50, quality='AntiAlias', auto_size=true, symbology='QR', image_format='png')
|
52
|
+
end
|
53
|
+
assert_equal true, File.exist?('../Output/barcodeQR.png')
|
54
|
+
end
|
55
|
+
|
56
|
+
def test_set_barcode_angle
|
57
|
+
builder = Aspose::Cloud::Barcode::Builder.new
|
58
|
+
assert_nothing_thrown 'Error' do
|
59
|
+
builder.set_barcode_angle(code_text='Text to generate barcode', rotation_angle=180, symbology='QR', image_format='png')
|
60
|
+
end
|
61
|
+
assert_equal true, File.exist?('../Output/barcodeQR.png')
|
62
|
+
end
|
63
|
+
|
64
|
+
def test_set_barcode_margin
|
65
|
+
builder = Aspose::Cloud::Barcode::Builder.new
|
66
|
+
assert_nothing_thrown 'Error' do
|
67
|
+
builder.set_barcode_margin(code_text='Text to generate barcode', top_margin=2, bottom_margin=2, left_margin=2, right_margin=2, symbology='QR', image_format='png')
|
68
|
+
end
|
69
|
+
assert_equal true, File.exist?('../Output/barcodeQR.png')
|
70
|
+
end
|
71
|
+
|
72
|
+
def test_set_barcode_resolution
|
73
|
+
builder = Aspose::Cloud::Barcode::Builder.new
|
74
|
+
assert_nothing_thrown 'Error' do
|
75
|
+
builder.set_barcode_resolution(code_text='Text to generate barcode', x_resolution=200, y_resolution=200, symbology='QR', image_format='png')
|
76
|
+
end
|
77
|
+
assert_equal true, File.exist?('../Output/barcodeQR.png')
|
78
|
+
end
|
79
|
+
|
80
|
+
def test_set_barcode_height
|
81
|
+
builder = Aspose::Cloud::Barcode::Builder.new
|
82
|
+
assert_nothing_thrown 'Error' do
|
83
|
+
builder.set_barcode_height(code_text='Text to generate barcode', height=20, gr_unit='pt', symbology='barcode128', image_format='png')
|
84
|
+
end
|
85
|
+
assert_equal true, File.exist?('../Output/barcodeQR.png')
|
86
|
+
end
|
87
|
+
|
88
|
+
def test_set_barcode_dimensions
|
89
|
+
builder = Aspose::Cloud::Barcode::Builder.new
|
90
|
+
assert_nothing_thrown 'Error' do
|
91
|
+
builder.set_barcode_dimensions(code_text='Text to generate barcode', x_dimension=1.0, y_dimension=0.5, symbology='QR', image_format='png')
|
92
|
+
end
|
93
|
+
assert_equal true, File.exist?('../Output/barcodeQR.png')
|
94
|
+
end
|
95
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require_relative '../../lib/asposecloud'
|
3
|
+
|
4
|
+
class ReaderTests < Test::Unit::TestCase
|
5
|
+
|
6
|
+
def setup
|
7
|
+
file = File.read('../setup.json')
|
8
|
+
data = JSON.parse(file)
|
9
|
+
|
10
|
+
Aspose::Cloud::Common::AsposeApp.app_key = data['app_key']
|
11
|
+
Aspose::Cloud::Common::AsposeApp.app_sid = data['app_sid']
|
12
|
+
Aspose::Cloud::Common::AsposeApp.output_location = data['output_location']
|
13
|
+
Aspose::Cloud::Common::Product.set_base_product_uri(data['product_uri'])
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_read
|
17
|
+
# Create Object of folder class
|
18
|
+
folder = Aspose::Cloud::AsposeStorage::Folder.new
|
19
|
+
response = folder.upload_file '../Data/barcodeQR.png'
|
20
|
+
assert_equal true, response
|
21
|
+
|
22
|
+
# Creae object of Reader class
|
23
|
+
reader = Aspose::Cloud::Barcode::Reader.new('barcodeQR.png')
|
24
|
+
response = reader.read()
|
25
|
+
assert_instance_of(Array, response)
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_read_barcode_local_image
|
29
|
+
reader = Aspose::Cloud::Barcode::Reader.new('barcodeQR.jpg')
|
30
|
+
response = reader.read_from_local_image(local_image = '../Data/barcodeQR.jpg')
|
31
|
+
assert_instance_of(Array, response)
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_readr
|
35
|
+
reader = Aspose::Cloud::Barcode::Reader.new('barcodeQR.png')
|
36
|
+
response = reader.readr(remote_image_name='barcodeQR.png')
|
37
|
+
assert_instance_of(Array, response)
|
38
|
+
end
|
39
|
+
|
40
|
+
def test_read_from_url
|
41
|
+
reader = Aspose::Cloud::Barcode::Reader.new('barcodeQR.png')
|
42
|
+
url = "http://upload.wikimedia.org/wikipedia/commons/c/ce/WikiQRCode.png"
|
43
|
+
response = reader.read_from_url(url, symbology='QR')
|
44
|
+
assert_instance_of(Array, response)
|
45
|
+
end
|
46
|
+
|
47
|
+
def test_read_specific_region
|
48
|
+
reader = Aspose::Cloud::Barcode::Reader.new('barcodeQR.png')
|
49
|
+
response = reader.read_specific_region(symbology='QR', rectX=20, rectY=20, rectWidth=100, rectHeight=100)
|
50
|
+
assert_instance_of(Array, response)
|
51
|
+
end
|
52
|
+
|
53
|
+
def test_read_with_checksum
|
54
|
+
reader = Aspose::Cloud::Barcode::Reader.new('barcodeQR.png')
|
55
|
+
response = reader.read_with_checksum(symbology='QR', checksumValidation='Default')
|
56
|
+
assert_instance_of(Array, response)
|
57
|
+
end
|
58
|
+
|
59
|
+
def test_read_barcode_count
|
60
|
+
reader = Aspose::Cloud::Barcode::Reader.new('barcodeQR.png')
|
61
|
+
response = reader.read_barcode_count(symbology='QR', barcodesCount=2)
|
62
|
+
assert_instance_of(Array, response)
|
63
|
+
end
|
64
|
+
|
65
|
+
def test_read_by_algorithm
|
66
|
+
reader = Aspose::Cloud::Barcode::Reader.new('barcodeQR.png')
|
67
|
+
response = reader.read_by_algorithm(symbology='Code128', algorithm='MedianSmoothing')
|
68
|
+
assert_instance_of(Array, response)
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,139 @@
|
|
1
|
+
|
2
|
+
require 'test/unit'
|
3
|
+
require_relative '../../lib/asposecloud'
|
4
|
+
|
5
|
+
class ChartEditorTests < Test::Unit::TestCase
|
6
|
+
|
7
|
+
def setup
|
8
|
+
file = File.read('../setup.json')
|
9
|
+
data = JSON.parse(file)
|
10
|
+
|
11
|
+
Aspose::Cloud::Common::AsposeApp.app_key = data['app_key']
|
12
|
+
Aspose::Cloud::Common::AsposeApp.app_sid = data['app_sid']
|
13
|
+
Aspose::Cloud::Common::AsposeApp.output_location = data['output_location']
|
14
|
+
Aspose::Cloud::Common::Product.set_base_product_uri(data['product_uri'])
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_add_chart
|
18
|
+
chart_editor = Aspose::Cloud::Cells::ChartEditor.new('test_cells.xlsx')
|
19
|
+
assert_nothing_thrown 'Error' do
|
20
|
+
chart_editor.add_chart(worksheet_name='Sheet1', chart_type='bar', upper_left_row=12, upper_left_column=12, lower_right_row=20, lower_right_column=20)
|
21
|
+
end
|
22
|
+
|
23
|
+
assert_equal true, File.exist?('../Output/test_cells.xlsx')
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_delete_charts
|
27
|
+
chart_editor = Aspose::Cloud::Cells::ChartEditor.new('test_cells.xlsx')
|
28
|
+
assert_nothing_thrown 'Error' do
|
29
|
+
chart_editor.delete_charts(worksheet_name='Sheet1')
|
30
|
+
end
|
31
|
+
|
32
|
+
assert_equal true, File.exist?('../Output/test_cells.xlsx')
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_delete_chart
|
36
|
+
chart_editor = Aspose::Cloud::Cells::ChartEditor.new('test_cells.xlsx')
|
37
|
+
assert_nothing_thrown 'Error' do
|
38
|
+
chart_editor.delete_chart(worksheet_name='Sheet1', chart_index=0)
|
39
|
+
end
|
40
|
+
|
41
|
+
assert_equal true, File.exist?('../Output/test_cells.xlsx')
|
42
|
+
end
|
43
|
+
|
44
|
+
def test_show_chart_legend
|
45
|
+
chart_editor = Aspose::Cloud::Cells::ChartEditor.new('test_cells.xlsx')
|
46
|
+
assert_nothing_thrown 'Error' do
|
47
|
+
chart_editor.show_chart_legend(worksheet_name='Sheet1', chart_index=1)
|
48
|
+
end
|
49
|
+
|
50
|
+
assert_equal true, File.exist?('../Output/test_cells.xlsx')
|
51
|
+
end
|
52
|
+
|
53
|
+
def test_hide_chart_legend
|
54
|
+
chart_editor = Aspose::Cloud::Cells::ChartEditor.new('test_cells.xlsx')
|
55
|
+
assert_nothing_thrown 'Error' do
|
56
|
+
chart_editor.hide_chart_legend(worksheet_name='Sheet1', chart_index=1)
|
57
|
+
end
|
58
|
+
|
59
|
+
assert_equal true, File.exist?('../Output/test_cells.xlsx')
|
60
|
+
end
|
61
|
+
|
62
|
+
def test_update_chart_legend
|
63
|
+
chart_editor = Aspose::Cloud::Cells::ChartEditor.new('test_cells.xlsx')
|
64
|
+
str_xml = '<Legend>
|
65
|
+
<Position>Right</Position>
|
66
|
+
<Font>
|
67
|
+
<Color>
|
68
|
+
<A>0</A>
|
69
|
+
<R>255</R>
|
70
|
+
<G>0</G>
|
71
|
+
<B>0</B>
|
72
|
+
</Color>
|
73
|
+
<DoubleSize>10</DoubleSize>
|
74
|
+
<IsBold>True</IsBold>
|
75
|
+
<IsItalic>False</IsItalic>
|
76
|
+
<IsStrikeout>False</IsStrikeout>
|
77
|
+
<IsSubscript>False</IsSubscript>
|
78
|
+
<IsSuperscript>False</IsSuperscript>
|
79
|
+
<Name>Arial</Name>
|
80
|
+
<Size>16</Size>
|
81
|
+
<Underline>None</Underline>
|
82
|
+
</Font>
|
83
|
+
<Shadow>True</Shadow>
|
84
|
+
</Legend>'
|
85
|
+
assert_nothing_thrown 'Error' do
|
86
|
+
chart_editor.update_chart_legend(worksheet_name='Sheet1', chart_index=1, str_xml)
|
87
|
+
end
|
88
|
+
|
89
|
+
assert_equal true, File.exist?('../Output/test_cells.xlsx')
|
90
|
+
end
|
91
|
+
|
92
|
+
def test_read_chart_legend
|
93
|
+
chart_editor = Aspose::Cloud::Cells::ChartEditor.new('test_cells.xlsx')
|
94
|
+
response = chart_editor.read_chart_legend(worksheet_name='Sheet1', chart_index=1)
|
95
|
+
assert_instance_of(Hash, response)
|
96
|
+
end
|
97
|
+
|
98
|
+
def test_get_chart_area
|
99
|
+
chart_editor = Aspose::Cloud::Cells::ChartEditor.new('test_cells.xlsx')
|
100
|
+
response = chart_editor.get_chart_area(worksheet_name='Sheet1', chart_index=1)
|
101
|
+
assert_instance_of(Hash, response)
|
102
|
+
end
|
103
|
+
|
104
|
+
def test_get_fill_format
|
105
|
+
chart_editor = Aspose::Cloud::Cells::ChartEditor.new('test_cells.xlsx')
|
106
|
+
response = chart_editor.get_fill_format(worksheet_name='Sheet1', chart_index=1)
|
107
|
+
assert_instance_of(Hash, response)
|
108
|
+
end
|
109
|
+
|
110
|
+
def test_get_border
|
111
|
+
chart_editor = Aspose::Cloud::Cells::ChartEditor.new('test_cells.xlsx')
|
112
|
+
response = chart_editor.get_border(worksheet_name='Sheet1', chart_index=1)
|
113
|
+
assert_instance_of(Hash, response)
|
114
|
+
end
|
115
|
+
|
116
|
+
def test_set_chart_title
|
117
|
+
chart_editor = Aspose::Cloud::Cells::ChartEditor.new('test_cells.xlsx')
|
118
|
+
str_xml = '<Title>
|
119
|
+
<Text>Sales Chart</Text>
|
120
|
+
</Title>'
|
121
|
+
response = chart_editor.set_chart_title(worksheet_name='Sheet1', chart_index=1, str_xml)
|
122
|
+
assert_equal true, File.exist?('../Output/test_cells.xlsx')
|
123
|
+
end
|
124
|
+
|
125
|
+
def test_update_chart_title
|
126
|
+
chart_editor = Aspose::Cloud::Cells::ChartEditor.new('test_cells.xlsx')
|
127
|
+
str_xml = '<Title>
|
128
|
+
<Text>Sales Chart</Text>
|
129
|
+
</Title>'
|
130
|
+
response = chart_editor.update_chart_title(worksheet_name='Sheet1', chart_index=1, str_xml)
|
131
|
+
assert_equal true, File.exist?('../Output/test_cells.xlsx')
|
132
|
+
end
|
133
|
+
|
134
|
+
def test_delete_chart_title
|
135
|
+
chart_editor = Aspose::Cloud::Cells::ChartEditor.new('test_cells.xlsx')
|
136
|
+
response = chart_editor.delete_chart_title(worksheet_name='Sheet1', chart_index=1)
|
137
|
+
assert_equal true, File.exist?('../Output/test_cells.xlsx')
|
138
|
+
end
|
139
|
+
end
|
@@ -0,0 +1,83 @@
|
|
1
|
+
|
2
|
+
require 'test/unit'
|
3
|
+
require_relative '../../lib/asposecloud'
|
4
|
+
|
5
|
+
class ConverterTests < Test::Unit::TestCase
|
6
|
+
|
7
|
+
def setup
|
8
|
+
file = File.read('../setup.json')
|
9
|
+
data = JSON.parse(file)
|
10
|
+
|
11
|
+
Aspose::Cloud::Common::AsposeApp.app_key = data['app_key']
|
12
|
+
Aspose::Cloud::Common::AsposeApp.app_sid = data['app_sid']
|
13
|
+
Aspose::Cloud::Common::AsposeApp.output_location = data['output_location']
|
14
|
+
Aspose::Cloud::Common::Product.set_base_product_uri(data['product_uri'])
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_convert_storage_file
|
18
|
+
folder = Aspose::Cloud::AsposeStorage::Folder.new
|
19
|
+
response = folder.upload_file '../Data/test_convert_cell.xlsx'
|
20
|
+
assert_equal true, response
|
21
|
+
|
22
|
+
converter = Aspose::Cloud::Cells::Converter.new('test_convert_cell.xlsx')
|
23
|
+
assert_nothing_thrown 'Error' do
|
24
|
+
converter.convert('../Output/converted_file.tiff','tiff')
|
25
|
+
end
|
26
|
+
|
27
|
+
assert_equal true, File.exist?('../Output/converted_file.tiff')
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_convert_to_image
|
31
|
+
converter = Aspose::Cloud::Cells::Converter.new('test_cells.xlsx')
|
32
|
+
assert_nothing_thrown 'Error' do
|
33
|
+
converter.convert_to_image(output_filename='convert_to_image', worksheet_name='Sheet2', save_format='tiff')
|
34
|
+
end
|
35
|
+
|
36
|
+
assert_equal true, File.exist?('../Output/convert_to_image.tiff')
|
37
|
+
end
|
38
|
+
|
39
|
+
def test_picture_to_image
|
40
|
+
converter = Aspose::Cloud::Cells::Converter.new('test_cells.xlsx')
|
41
|
+
assert_nothing_thrown 'Error' do
|
42
|
+
converter.picture_to_image(picture_index=0, worksheet_name='Sheet2', save_format='tiff')
|
43
|
+
end
|
44
|
+
|
45
|
+
assert_equal true, File.exist?('../Output/test_cells.tiff')
|
46
|
+
end
|
47
|
+
|
48
|
+
def test_oleobject_to_image
|
49
|
+
converter = Aspose::Cloud::Cells::Converter.new('test_cells.xlsx')
|
50
|
+
assert_nothing_thrown 'Error' do
|
51
|
+
converter.oleobject_to_image(object_index=0, worksheet_name='Sheet2', save_format='png')
|
52
|
+
end
|
53
|
+
|
54
|
+
assert_equal true, File.exist?('../Output/test_cells.png')
|
55
|
+
end
|
56
|
+
|
57
|
+
def test_chart_to_image
|
58
|
+
converter = Aspose::Cloud::Cells::Converter.new('test_cells.xlsx')
|
59
|
+
assert_nothing_thrown 'Error' do
|
60
|
+
converter.chart_to_image(chart_index=0, worksheet_name='Sheet2', save_format='gif')
|
61
|
+
end
|
62
|
+
|
63
|
+
assert_equal true, File.exist?('../Output/test_cells.gif')
|
64
|
+
end
|
65
|
+
|
66
|
+
def test_autoshape_to_image
|
67
|
+
converter = Aspose::Cloud::Cells::Converter.new('test_cells.xlsx')
|
68
|
+
assert_nothing_thrown 'Error' do
|
69
|
+
converter.autoshape_to_image(shape_index=0, worksheet_name='Sheet2', save_format='tiff')
|
70
|
+
end
|
71
|
+
|
72
|
+
assert_equal true, File.exist?('../Output/test_cells.tiff')
|
73
|
+
end
|
74
|
+
|
75
|
+
def test_convert_local_file
|
76
|
+
converter = Aspose::Cloud::Cells::Converter.new('test_cells.xlsx')
|
77
|
+
assert_nothing_thrown 'Error' do
|
78
|
+
converter.convert_local_file(input_file='../Data/test_convert_cell.xlsx', output_filename='convert-local.tiff', save_format='tiff')
|
79
|
+
end
|
80
|
+
|
81
|
+
assert_equal true, File.exist?('../Output/convert-local.tiff')
|
82
|
+
end
|
83
|
+
end
|