Skip to content

Commit 7ebdcfc

Browse files
committed
20220418 update : update four api.
1 parent 0cf27df commit 7ebdcfc

File tree

9 files changed

+110
-19
lines changed

9 files changed

+110
-19
lines changed

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![](https://img.shields.io/badge/REST%20API-v3.0-lightgrey) ![Gem](https://img.shields.io/gem/v/aspose_cells_cloud) ![Gem](https://img.shields.io/gem/dt/aspose_cells_cloud) [![GitHub license](https://img.shields.io/github/license/aspose-cells-cloud/aspose-cells-cloud-ruby)](https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby/blob/master/LICENSE) ![GitHub commits since latest release (by date)](https://img.shields.io/github/commits-since/aspose-cells-cloud/aspose-cells-cloud-ruby/22.3)
1+
![](https://img.shields.io/badge/REST%20API-v3.0-lightgrey) ![Gem](https://img.shields.io/gem/v/aspose_cells_cloud) ![Gem](https://img.shields.io/gem/dt/aspose_cells_cloud) [![GitHub license](https://img.shields.io/github/license/aspose-cells-cloud/aspose-cells-cloud-ruby)](https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby/blob/master/LICENSE) ![GitHub commits since latest release (by date)](https://img.shields.io/github/commits-since/aspose-cells-cloud/aspose-cells-cloud-ruby/22.4)
22

33

44
# Ruby SDK for Spreadsheet Processing in the Cloud
@@ -22,9 +22,12 @@ Ruby Cloud SDK wraps Aspose.Cells REST API so you could seamlessly integrate Mic
2222
- [Convert Excel files to popular formats](https://docs.aspose.cloud/cells/convert-excel-workbook-to-different-file-formats/).
2323

2424

25-
## Feature & Enhancements in Version 22.3
25+
## Feature & Enhancements in Version 22.4
2626

27-
- Add new API about adding digital signature for cloud file.
27+
- Export API adds extended query parameters.
28+
- Convert API adds extended query parameters.
29+
- SaveAs API adds extended query parameters.
30+
- Get Workbook API adds extended query parameters.
2831

2932

3033
## Read & Write Spreadsheet Formats

lib/aspose_cells_cloud/api/cells_api.rb

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13316,7 +13316,11 @@ def cells_save_as_post_document_save_as_with_http_info(name, opts = {})
1331613316
query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
1331713317
query_params[:'storageName'] = opts[:'storage_name'] if !opts[:'storage_name'].nil?
1331813318
query_params[:'outStorageName'] = opts[:'out_storage_name'] if !opts[:'out_storage_name'].nil?
13319-
13319+
if opts[:'extendedQueryParameters']
13320+
opts[:'extendedQueryParameters'].each do |key , value|
13321+
query_params[key] = value
13322+
end
13323+
end
1332013324
# header parameters
1332113325
header_params = {}
1332213326
# HTTP header 'Accept' (if needed)
@@ -14978,7 +14982,11 @@ def cells_workbook_get_workbook_with_http_info(name, opts = {})
1497814982
query_params[:'storageName'] = opts[:'storage_name'] if !opts[:'storage_name'].nil?
1497914983
query_params[:'outPath'] = opts[:'out_path'] if !opts[:'out_path'].nil?
1498014984
query_params[:'outStorageName'] = opts[:'out_storage_name'] if !opts[:'out_storage_name'].nil?
14981-
14985+
if opts[:'extendedQueryParameters']
14986+
opts[:'extendedQueryParameters'].each do |key , value|
14987+
query_params[key] = value
14988+
end
14989+
end
1498214990
# header parameters
1498314991
header_params = {}
1498414992
# HTTP header 'Accept' (if needed)
@@ -16367,7 +16375,11 @@ def cells_workbook_put_convert_workbook_with_http_info(file, opts = {})
1636716375
query_params[:'password'] = opts[:'password'] if !opts[:'password'].nil?
1636816376
query_params[:'outPath'] = opts[:'out_path'] if !opts[:'out_path'].nil?
1636916377
query_params[:'storageName'] = opts[:'storage_name'] if !opts[:'storage_name'].nil?
16370-
16378+
if opts[:'extendedQueryParameters']
16379+
opts[:'extendedQueryParameters'].each do |key , value|
16380+
query_params[key] = value
16381+
end
16382+
end
1637116383
# header parameters
1637216384
header_params = {}
1637316385
# HTTP header 'Accept' (if needed)

lib/aspose_cells_cloud/api/light_cells_api.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,11 @@ def post_export_with_http_info(file, object_type, format, opts = {})
344344
query_params = {}
345345
query_params[:'objectType'] = object_type
346346
query_params[:'format'] = format
347+
if opts[:'extendedQueryParameters']
348+
opts[:'extendedQueryParameters'].each do |key , value|
349+
query_params[key] = value
350+
end
351+
end
347352

348353
# header parameters
349354
header_params = {}

lib/aspose_cells_cloud/api_client.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def build_request(http_method, path, opts = {})
116116
:params => query_params,
117117
:body => body
118118
}
119-
119+
print query_params
120120
if [:post, :patch, :put, :delete].include?(http_method)
121121
req_body = build_request_body(header_params, form_params, opts[:body])
122122
req_opts.update :body => req_body
@@ -137,7 +137,7 @@ def build_request(http_method, path, opts = {})
137137
f.request :url_encoded
138138
f.adapter Faraday.default_adapter
139139
end
140-
140+
141141
if req_opts[:body] == {}
142142
req_opts[:body] = nil
143143
end

lib/aspose_cells_cloud/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@
2121
=end
2222

2323
module AsposeCellsCloud
24-
VERSION = "22.3"
24+
VERSION = "22.4"
2525
end

spec/api/cells_export_spec.rb

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@
161161
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
162162
end
163163
end
164+
164165
describe 'lite_cells_unit export object test' do
165166
it "should work" do
166167
files = {}
@@ -169,11 +170,26 @@
169170
name =$AssemblyTestXlsx
170171
files[name] = ::File.open(File.expand_path("data/"+name),"r")
171172

173+
172174
result = @instance.post_export(files ,"workbook","pdf")
173175

174176
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
175-
end
177+
end
176178
end
179+
180+
describe 'lite_cells_unit export object test' do
181+
it "should work" do
182+
files = {}
183+
name = $DataSourceXlsx
184+
files[name] = ::File.open(File.expand_path("data/"+name),"r")
185+
name =$AssemblyTestXlsx
186+
files[name] = ::File.open(File.expand_path("data/"+name),"r")
187+
188+
result = @instance.post_export(files ,"listobject","xlsx")
189+
190+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
191+
end
192+
end
177193

178194
describe 'lite_cells_unit export object test' do
179195
it "should work" do
@@ -211,10 +227,13 @@
211227
name =$AssemblyTestXlsx
212228
files[name] = ::File.open(File.expand_path("data/"+name),"r")
213229

214-
result = @instance.post_export(files ,"listobject","xlsx")
230+
extendedQueryParameters = {}
231+
extendedQueryParameters['OnePagePerSheet'] = 'false'
232+
result = @instance.post_export(files ,"listobject","pdf", { :extendedQueryParameters=>extendedQueryParameters})
215233

216234
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
217235
end
218236
end
237+
219238
end
220239

spec/api/cells_save_as_api_spec.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,21 @@
8686
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
8787
end
8888
end
89+
describe 'cells_save_as_post_document_save_as to extend format test' do
90+
it "should work" do
91+
name = $BOOK1
92+
save_options = nil
93+
newfilename = 'newbook.xls.md'
94+
is_auto_fit_rows = true
95+
is_auto_fit_columns = true
96+
folder = $TEMPFOLDER
97+
extendedQueryParameters = {}
98+
extendedQueryParameters['OnePagePerSheet'] = 'false'
99+
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
100+
expect(result.uploaded.size).to be > 0
101+
result = @instance.cells_save_as_post_document_save_as(name, { :save_options=>save_options, :newfilename=>(folder+"/"+newfilename), :is_auto_fit_rows=>is_auto_fit_rows, :is_auto_fit_columns=>is_auto_fit_columns, :folder=>folder,:extendedQueryParameters=>extendedQueryParameters})
102+
expect(result.code).to eql(200)
103+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
104+
end
105+
end
89106
end

spec/api/cells_simple_spec.rb

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,18 @@
2929
describe 'cells_ranges_post_worksheet_cells_range_outline_border test' do
3030
it "should work" do
3131
name = $BOOK1
32-
sheet_name = $SHEET1
33-
color = AsposeCellsCloud::Color.new({:A=>255})
34-
range = AsposeCellsCloud::Range.new({:ColumnCount=>1,:FirstColumn=>1,:FirstRow=>1,:RowCount=>10})
35-
range_operate = AsposeCellsCloud::RangeSetOutlineBorderRequest.new({:BorderEdge=>'LeftBorder',:BorderStyle=>'Dotted',:BorderColor=>color,:Range=>range })
32+
password = nil
33+
format = 'pdf'
34+
is_auto_fit = true
35+
only_save_table = true
3636
folder = $TEMPFOLDER
37-
# result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
38-
# expect(result.uploaded.size).to be > 0
39-
result = @instance.cells_ranges_post_worksheet_cells_range_outline_border(name, sheet_name, { :range_operate=>range_operate, :folder=>folder})
40-
expect(result.code).to eql(200)
37+
out_path = nil
38+
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
39+
expect(result.uploaded.size).to be > 0
40+
extendedQueryParameters = {}
41+
extendedQueryParameters['OnePagePerSheet'] = 'false'
42+
result = @instance.cells_workbook_get_workbook(name, { :password=>password, :format=>format,:folder=>folder, :out_path=>out_path, :extendedQueryParameters=>extendedQueryParameters})
43+
# expect(result.code).to eql(200)
4144
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
4245
end
4346
end

spec/api/cells_workbook_api_spec.rb

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,24 @@
6363
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
6464
end
6565
end
66+
describe 'cells_workbook_get_workbook to extend test' do
67+
it "should work" do
68+
name = $BOOK1
69+
password = nil
70+
format = 'XPS'
71+
is_auto_fit = true
72+
only_save_table = true
73+
folder = $TEMPFOLDER
74+
out_path = nil
75+
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
76+
expect(result.uploaded.size).to be > 0
77+
extendedQueryParameters = {}
78+
extendedQueryParameters['OnePagePerSheet'] = 'false'
79+
result = @instance.cells_workbook_get_workbook(name, { :password=>password, :format=>format,:folder=>folder, :out_path=>out_path, :extendedQueryParameters=>extendedQueryParameters})
80+
# expect(result.code).to eql(200)
81+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
82+
end
83+
end
6684
# unit tests for cells_workbook_get_workbook
6785
# Read workbook info or export.
6886
#
@@ -512,6 +530,20 @@
512530
end
513531
end
514532

533+
describe 'cells_workbook_put_convert_workbook_extend test' do
534+
it "should work" do
535+
name = $BOOK1
536+
format = 'pdf'
537+
password = nil
538+
out_path = "Tdd.pdf"
539+
extendedQueryParameters = {}
540+
extendedQueryParameters['OnePagePerSheet'] = 'false'
541+
result = @instance.cells_workbook_put_convert_workbook( ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) },{:format=>format,out_path=>out_path,:extendedQueryParameters=>extendedQueryParameters})
542+
# expect(result.code).to eql(200)
543+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
544+
end
545+
end
546+
515547
# unit tests for cells_workbook_put_workbook_create
516548
# Create new workbook using deferent methods.
517549
#

0 commit comments

Comments
 (0)