Skip to content

Commit

Permalink
Release Aspose.Cells.Cloud SDK 20.2
Browse files Browse the repository at this point in the history
  • Loading branch information
roywangaspose committed Feb 21, 2020
1 parent 4bfebc5 commit 8ab94f8
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 21 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Aspose.Cells Cloud SDK for Ruby

- API version: 3.0
- SDK version: 19.10
- SDK version: 20.2

This repository contains Aspose.Cells Cloud SDK for Ruby source code. This SDK allows you to work with Aspose.Cells Cloud REST APIs in your Ruby applications quickly and easily, with zero initial cost.

Expand Down Expand Up @@ -54,7 +54,7 @@ The complete source code is available in this repository folder. You can either



To use Aspose.Cells Cloud SDK you need to register an account with [Aspose Cloud](https://www.aspose.cloud/) and lookup/create App Key and SID at [Cloud Dashboard](https://dashboard.aspose.cloud/#/apps). There is free quota available. For more details, see [Aspose Cloud Pricing](https://purchase.aspose.cloud/pricing).
To use Aspose.Cells Cloud SDK for Ruby you need to register an account with [Aspose Cloud](https://www.aspose.cloud/) and lookup/create App Key and SID at [Cloud Dashboard](https://dashboard.aspose.cloud/#/apps). There is free quota available. For more details, see [Aspose Cloud Pricing](https://purchase.aspose.cloud/pricing).



Expand Down
5 changes: 3 additions & 2 deletions lib/aspose_cells_cloud/api/cells_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14949,7 +14949,7 @@ def cells_workbook_put_convert_workbook_with_http_info(workbook, opts = {})
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
# HTTP header 'Content-Type'
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream'])
# form parameters
form_params = {}

Expand Down Expand Up @@ -15015,7 +15015,8 @@ def cells_workbook_put_document_protect_from_changes_with_http_info(name, opts =
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
# HTTP header 'Content-Type'
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream'])
# form parameters
form_params = {}

Expand Down
10 changes: 9 additions & 1 deletion lib/aspose_cells_cloud/api_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class ApiClient
# @return [Hash]
attr_accessor :default_headers

attr_accessor :get_access_token_time
# Initializes the ApiClient
# @option config [Configuration] Configuration for initializing the object, default to Configuration.default
def initialize(config = Configuration.default)
Expand Down Expand Up @@ -415,9 +416,14 @@ def build_collection_param(param, collection_format)

# Request access and refresh tokens if needed
def request_token_if_needed

# check token exists
if @config.access_token
return
now = Time.now
time_difference = now - $get_access_token_time
if time_difference < 86300
return
end
end

# resource path
Expand Down Expand Up @@ -471,6 +477,8 @@ def request_token_if_needed
data = JSON.parse("[#{response.body}]", :symbolize_names => true)[0]

@config.access_token = data[:access_token]

$get_access_token_time = Time.now
end

# Adds OAuth2.0 token
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.1"
VERSION = "20.2"
end
10 changes: 5 additions & 5 deletions spec/api/cells_storage_api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,20 @@
it "should work" do
name ="ReportData.xml"
folder = $TEMPFOLDER
# stream = File.read("/home/roywang/asposecellscloudsdk/data/" << name)
# stream = File.read("data/" << name)
# @instance.object_exists(name)
# @instance.storage_exists("Default App");
# filename = folder +"/" + name
# aFile = File.new("/home/roywang/asposecellscloudsdk/data/" +name , 'rb')
# aFile = File.new("data/" +name , 'rb')
# stream = aFile.sysread(aFile.size)
# aFile.close
# binary_file = File.open("/home/roywang/asposecellscloudsdk/data/" +name, "rb")
# binary_file = File.open("data/" +name, "rb")
# data = [
# [ "import[sync]","false" ],
# [ "import[name]", stream, { filename: "Book1.xlsx"} ]
# ]
# stream = File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }
@instance.upload_file( "Temp/ReportData.xml", ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) })
# stream = File.open("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");
# @instance.move_folder(folder+ "2", folder + "3");
Expand Down
9 changes: 4 additions & 5 deletions spec/api/cells_storage_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,17 @@
folder = $TEMPFOLDER
@instance.create_folder("ruby")
@instance.copy_folder("ruby","ruby1")
@instance.delete_folder("ruby")
@instance.move_folder("ruby1","ruby")
@instance.upload_file( "ruby/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) })
@instance.upload_file( "ruby/"+name, ::File.open("data/" +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)
@instance.download_file("ruby/"+name)
# @instance.delete_file("ruby/"+name)
# @instance.delete_folder("ruby")
@instance.delete_file("ruby/"+name)
@instance.delete_folder("ruby")


#@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})
#@instance.cells_workbook_put_convert_workbook(::File.open("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_workbook_api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@
format = 'pdf'
password = nil
out_path = "Tdd.pdf"
result = @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})
result = @instance.cells_workbook_put_convert_workbook(::File.open("data/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
4 changes: 2 additions & 2 deletions spec/api/cells_worksheets_api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
it "should work" do
name = $BOOK1
sheet_name = $SHEET1
aFile = File.new('/home/roywang/asposecellscloudsdk/data/WaterMark.png', 'r')
aFile = File.new('data/WaterMark.png', 'r')
png = aFile.sysread(aFile.size)
aFile.close
folder = $TEMPFOLDER
Expand Down Expand Up @@ -617,7 +617,7 @@
cell_name = 'C1'
comment = AsposeCellsCloud::Comment.new({:Author=>'Roy'})
folder = $TEMPFOLDER
@instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) })
@instance.upload_file( folder+"/"+name, ::File.open("data/" +name,"r") {|io| io.read(io.size) })
@instance.cells_worksheets_put_worksheet_comment(name, sheet_name, cell_name, {:comment=>comment, :folder=>folder})
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
end
Expand Down
4 changes: 2 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# load the gem
require 'aspose_cells_cloud'
$grant_type = 'client_credentials' # replace NULL with a proper value
$client_id = '66164C51-693E-4904-A121-545961673EC1' # '66164C51-693E-4904-A121-545961673EC1' # replace NULL with a proper value
$client_secret = '536e76768419db9585afdd37bb5f7533' # '536e76768419db9585afdd37bb5f7533' # replace NULL with a proper value
$client_id = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' # replace NULL with a proper value
$client_secret = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' # replace NULL with a proper value
$access_token
$BOOK1 = "Book1.xlsx"
$MYDOC = "myDocument.xlsx"
Expand Down

0 comments on commit 8ab94f8

Please sign in to comment.