Skip to content

Commit

Permalink
Release Aspose.Cells Cloud SDK 20.7
Browse files Browse the repository at this point in the history
  • Loading branch information
roywangaspose committed Jul 23, 2020
1 parent 0f674c5 commit 63c502e
Show file tree
Hide file tree
Showing 14 changed files with 94 additions and 141 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ This Cloud SDK enhances your Ruby cloud-based apps to [process & manipulate Micr
- Cloud SDK to Read & Process Excel Worksheets.
- Leverage the Power of Pivot Tables & Ranges.

## Feature & Enhancements in Version 20.6
## Feature & Enhancements in Version 20.7

- Support to add text water marker.
- Enhancement for Cells object operating in Task API.
- Enhancement for workbook convert images in get workbook API.
- Enhancement for CellsApi constructor.

## Read & Write Spreadsheet Formats

Expand Down
3 changes: 2 additions & 1 deletion lib/aspose_cells_cloud/api/cells_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ module AsposeCellsCloud
class CellsApi
attr_accessor :api_client

def initialize(app_sid,app_key, app_version = 'v3.0', api_client = ApiClient.default)
def initialize(app_sid,app_key, app_version = 'v3.0', app_host = 'api.aspose.cloud', api_client = ApiClient.default)
@api_client = api_client
@api_client.config.app_key = app_key
@api_client.config.app_sid = app_sid
@api_client.config.api_version = app_version
@api_client.config.host = app_host
end

# Removes a date filter.
Expand Down
2 changes: 1 addition & 1 deletion lib/aspose_cells_cloud/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@
=end

module AsposeCellsCloud
VERSION = "20.6"
VERSION = "20.7"
end
53 changes: 27 additions & 26 deletions spec/api/cells_api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
expect(result.uploaded.size).to be > 0
result = @instance.cells_get_worksheet_cell(name, sheet_name, cell_or_method_name, { :folder=>folder})
print(result)
#expect(result.code).to eql(200)
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
end
end
Expand Down Expand Up @@ -309,32 +310,32 @@
end
end

# unit tests for cells_post_cell_characters
# Set cell characters
#
# @param name
# @param sheet_name
# @param cell_name
# @param [Hash] opts the optional parameters
# @option opts [Array<FontSetting>] :options
# @option opts [String] :folder
# @option opts [String] :storage storage name.
# @return [CellsCloudResponse]
describe 'cells_post_cell_characters test' do
it "should work" do
name = $BOOK1
sheet_name = $SHEET1
cell_name = $CellName
options = nil
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_post_cell_characters(name, sheet_name, cell_name, { :options=>options,:folder=>folder})
expect(result.code).to eql(200)
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
end
end
# # unit tests for cells_post_cell_characters
# # Set cell characters
# #
# # @param name
# # @param sheet_name
# # @param cell_name
# # @param [Hash] opts the optional parameters
# # @option opts [Array<FontSetting>] :options
# # @option opts [String] :folder
# # @option opts [String] :storage storage name.
# # @return [CellsCloudResponse]
# describe 'cells_post_cell_characters test' do
# it "should work" do
# name = $BOOK1
# sheet_name = $SHEET1
# cell_name = $CellName
# options = nil
# folder = $TEMPFOLDER
# storage = nil
# result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
# expect(result.uploaded.size).to be > 0
# result = @instance.cells_post_cell_characters(name, sheet_name, cell_name, { :options=>options,:folder=>folder})
# expect(result.code).to eql(200)
# # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
# end
# end

# unit tests for cells_post_clear_contents
# Clear cells contents.
Expand Down
4 changes: 3 additions & 1 deletion spec/api/cells_ole_objects_api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,10 @@
image_file = 'word.jpg'
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
result = @instance.upload_file( folder+"/"+ole_file, ::File.open(File.expand_path("data/"+ole_file),"r") {|io| io.read(io.size) })
result = @instance.upload_file( folder+"/"+image_file, ::File.open(File.expand_path("data/"+image_file),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_ole_objects_put_worksheet_ole_object(name, sheet_name, { :ole_object=>ole_object, :upper_left_row=>upper_left_row, :upper_left_column=>upper_left_column, :height=>height, :width=>width, :ole_file=>ole_file, :image_file=>image_file,:folder=>folder})
result = @instance.cells_ole_objects_put_worksheet_ole_object(name, sheet_name, { :ole_object=>ole_object, :upper_left_row=>upper_left_row, :upper_left_column=>upper_left_column, :height=>height, :width=>width, :ole_file=> (folder+"/"+ole_file), :image_file=> (folder+"/"+image_file),:folder=>folder})
expect(result.code).to eql(200)
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
end
Expand Down
4 changes: 2 additions & 2 deletions spec/api/cells_page_breaks_api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
it "should work" do
name = $BOOK1
sheet_name = $SHEET1
row = 1
row = 0
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
Expand Down Expand Up @@ -255,7 +255,7 @@
it "should work" do
name = $BOOK1
sheet_name = $SHEET1
column = 1
column = 0
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
Expand Down
3 changes: 2 additions & 1 deletion spec/api/cells_pictures_api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,9 @@
picture_path = 'WaterMark.png'
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
result = @instance.upload_file( folder+"/"+picture_path, ::File.open(File.expand_path("data/"+picture_path),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_pictures_put_worksheet_add_picture(name, sheet_name, {:picture=>picture, :upper_left_row=>upper_left_row, :upper_left_column=>upper_left_column, :lower_right_row=>lower_right_row, :lower_right_column=>lower_right_column, :picture_path=>picture_path, :folder=>folder})
result = @instance.cells_pictures_put_worksheet_add_picture(name, sheet_name, {:picture=>picture, :upper_left_row=>upper_left_row, :upper_left_column=>upper_left_column, :lower_right_row=>lower_right_row, :lower_right_column=>lower_right_column, :picture_path=>(folder+"/"+picture_path), :folder=>folder})
expect(result.code).to eql(200)
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
end
Expand Down
32 changes: 4 additions & 28 deletions spec/api/cells_pivot_tables_api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -377,12 +377,15 @@
need_re_calculate = true
folder = $TEMPFOLDER
filter_index =0
field_index=0
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_pivot_tables_put_worksheet_pivot_table_filter(name, sheet_name, pivot_table_index, { :filter=>filter, :need_re_calculate=>need_re_calculate, :folder=>folder})
expect(result.code).to eql(200)
result = @instance.cells_pivot_tables_get_worksheet_pivot_table_filter(name, sheet_name, pivot_table_index, filter_index, { :folder=>folder})
expect(result.code).to eql(200)
expect(result.code).to eql(200)
result = @instance.cells_pivot_tables_delete_worksheet_pivot_table_filter(name, sheet_name, pivot_table_index, field_index, {:need_re_calculate=>need_re_calculate, :folder=>folder})
expect(result.code).to eql(200)
end
end

Expand Down Expand Up @@ -438,33 +441,6 @@
end
end

# unit tests for cells_pivot_tables_delete_worksheet_pivot_table_filter
# delete pivot filter for piovt table
#
# @param name
# @param sheet_name
# @param pivot_table_index
# @param field_index
# @param [Hash] opts the optional parameters
# @option opts [BOOLEAN] :need_re_calculate
# @option opts [String] :folder
# @option opts [String] :storage storage name.
# @return [CellsCloudResponse]
describe 'cells_pivot_tables_delete_worksheet_pivot_table_filter test' do
it "should work" do
name = $PivTestFile
sheet_name = $SHEET4
pivot_table_index = 0
field_index = 0
need_re_calculate = true
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_pivot_tables_delete_worksheet_pivot_table_filter(name, sheet_name, pivot_table_index, field_index, {:need_re_calculate=>need_re_calculate, :folder=>folder})
expect(result.code).to eql(200)
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
end
end

# unit tests for cells_pivot_tables_delete_worksheet_pivot_table_filters
# delete all pivot filters for piovt table
Expand Down
4 changes: 2 additions & 2 deletions spec/api/cells_save_as_api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_save_as_post_document_save_as(name, { :save_options=>save_options, :newfilename=>newfilename, :is_auto_fit_rows=>is_auto_fit_rows, :is_auto_fit_columns=>is_auto_fit_columns, :folder=>folder})
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})
expect(result.code).to eql(200)
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
end
Expand Down Expand Up @@ -65,7 +65,7 @@
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_save_as_post_document_save_as(name, { :save_options=>save_options, :newfilename=>newfilename, :is_auto_fit_rows=>is_auto_fit_rows, :is_auto_fit_columns=>is_auto_fit_columns, :folder=>folder})
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})
expect(result.code).to eql(200)
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
end
Expand Down
8 changes: 4 additions & 4 deletions spec/api/cells_storage_api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,19 @@
it "should work" do
name ="ReportData.xml"
folder = $TEMPFOLDER
# stream = File.read("data/" << name)
# stream = File.read("/home/roywang/asposecellscloudsdk/data/" << name)
# @instance.object_exists(name)
# @instance.storage_exists("Default App");
# filename = folder +"/" + name
# aFile = File.new("data/" +name , 'rb')
# aFile = File.new("/home/roywang/asposecellscloudsdk/data/" +name , 'rb')
# stream = aFile.sysread(aFile.size)
# aFile.close
# binary_file = File.open("data/" +name, "rb")
# binary_file = File.open("/home/roywang/asposecellscloudsdk/data/" +name, "rb")
# data = [
# [ "import[sync]","false" ],
# [ "import[name]", stream, { filename: "Book1.xlsx"} ]
# ]
# stream = File.open("data/" +name,"r") {|io| io.read(io.size) }
# stream = File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }
@instance.upload_file( "Temp/ReportData.xml", ::File.open("data/" +name,"r") {|io| io.read(io.size) })
# @instance.copy_file(name , folder +"/1"+ name)
# @instance.copy_folder(folder, folder + "2");
Expand Down
15 changes: 4 additions & 11 deletions spec/api/cells_storage_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,8 @@
end


# unit tests for cells_workbook_put_convert_workbook
# Convert workbook from request content to some format.
#
# @param [Hash] opts the optional parameters
# @option opts [String] :format The format to convert.
# @option opts [String] :password The workbook password.
# @option opts [String] :out_path Path to save result
# @return [File]
describe 'cells_workbook_put_convert_workbook test' do

describe 'cells_storage_test' do
it "should work" do
format = 'pdf'
password = nil
Expand All @@ -32,7 +25,7 @@
@instance.create_folder("ruby")
@instance.copy_folder("ruby","ruby1")
@instance.move_folder("ruby1","ruby")
@instance.upload_file( "ruby/"+name, ::File.open("data/" +name,"r") {|io| io.read(io.size) })
@instance.upload_file( "ruby/"+name, ::File.open("/home/roy/aspose/cells/cloud/sdk/TestData/" +name,"r") {|io| io.read(io.size) })
@instance.copy_file("ruby/"+name,"ruby/1"+name)
@instance.delete_file("ruby/"+name)
@instance.move_file("ruby/1"+name,"ruby/"+name)
Expand All @@ -41,7 +34,7 @@
@instance.delete_folder("ruby")


#@instance.cells_workbook_put_convert_workbook(::File.open("data/Book1.xlsx","r") {|io| io.read(io.size) },{:format=>format,out_path=>out_path})
#@instance.cells_workbook_put_convert_workbook(::File.open("/home/roywang/asposecellscloudsdk/data/Book1.xlsx","r") {|io| io.read(io.size) },{:format=>format,out_path=>out_path})
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/api/cells_task_api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
# taskData.setTasks(tasks);
# taskData.getTasks().add(task1);

param1 = AsposeCellsCloud::SplitWorkbookTaskParameter.new({:DestinationFileFormat=>'xlsx' ,:DestinationFilePosition=> AsposeCellsCloud::FileSource.new({:FilePath=>$TEMPFOLDER,:FileSourceType=>'CloudFileSystem'}),:SplitNameRule=>'sheetname',:Workbook=>AsposeCellsCloud::FileSource.new({:FilePath=>$TEMPFOLDER +'\\' + $BOOK1,:FileSourceType=>'CloudFileSystem'})})
param1 = AsposeCellsCloud::SplitWorkbookTaskParameter.new({:DestinationFileFormat=>'xlsx' ,:DestinationFilePosition=> AsposeCellsCloud::FileSource.new({:FileSourceType=>'CloudFileSystem'}),:SplitNameRule=>'sheetname',:Workbook=>AsposeCellsCloud::FileSource.new({:FilePath=>$TEMPFOLDER +'\\' + $BOOK1,:FileSourceType=>'CloudFileSystem'})})
task1 =AsposeCellsCloud::TaskDescription.new({:TaskType=>'SplitWorkbook',:TaskParameter=>param1})
task_data = AsposeCellsCloud::TaskData.new(:Tasks=>[task1])
result = @instance.cells_task_post_run_task(task_data)
Expand Down
31 changes: 6 additions & 25 deletions spec/api/cells_workbook_api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,9 @@
folder = $TEMPFOLDER
out_path = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
result = @instance.upload_file( folder+"/"+xml_file, ::File.open(File.expand_path("data/"+xml_file),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_workbook_post_workbook_get_smart_marker_result(name, { :xml_file=>xml_file,:folder=>folder})
result = @instance.cells_workbook_post_workbook_get_smart_marker_result(name, { :xml_file=>(folder+"/"+xml_file),:folder=>folder})
# expect(result.code).to eql(200)
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
end
Expand Down Expand Up @@ -368,8 +369,9 @@
merge_with = 'myDocument.xlsx'
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
result = @instance.upload_file( folder+"/"+merge_with, ::File.open(File.expand_path("data/"+merge_with),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_workbook_post_workbooks_merge(name, merge_with, { :folder=>folder})
result = @instance.cells_workbook_post_workbooks_merge(name,(folder+"/"+ merge_with), { :folder=>folder})
expect(result.code).to eql(200)
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
end
Expand Down Expand Up @@ -435,7 +437,7 @@
format = 'pdf'
password = nil
out_path = "Tdd.pdf"
result = @instance.cells_workbook_put_convert_workbook(::File.open("data/Book1.xlsx","r") {|io| io.read(io.size) },{:format=>format,out_path=>out_path})
result = @instance.cells_workbook_put_convert_workbook(::File.open("/home/roy/aspose/cells/cloud/sdk/TestData/Book1.xlsx","r") {|io| io.read(io.size) },{:format=>format,out_path=>out_path})
# expect(result.code).to eql(200)
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
end
Expand Down Expand Up @@ -634,26 +636,5 @@
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
end
end
describe 'cells_workbook_delete_workbook_background test' do
it "should work" do
name = $BOOK1
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_workbook_delete_workbook_background(name, {:folder=>folder})
expect(result.code).to eql(200)
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
end
end
describe 'cells_workbook_put_workbook_background test' do
it "should work" do
name = $BOOK1
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_workbook_put_workbook_background(name, ::File.open(File.expand_path("data/WaterMark.png"),"r") {|io| io.read(io.size) } ,{:folder=>folder})
expect(result.code).to eql(200)
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
end
end

end
Loading

0 comments on commit 63c502e

Please sign in to comment.