cloudxls 0.7.0 → 2.0.0.pre.beta

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e911a06e80702fbc54262bcd3cbc18a062be0a80
4
+ data.tar.gz: ea552bd27ba131071ffc9208917e4d9eed337a7c
5
+ SHA512:
6
+ metadata.gz: 8190f8b90d96ef9cf5bfc76f2f843119f8ba9afc6557b59f660eaae3bcff641f068f93a7754ffe5dce526ff6bac1eb0dd67d2e752f5de18478406fd6b13ce8d9
7
+ data.tar.gz: 441c7f7eed10b3e53683f5c37e38ce2450083e571f56719a28365d445a2177a1b87125a0e5d49bf7580951cfe49867235d2c1b18b52f37e7d8a6bebed54b3c9f
data/LICENSE ADDED
@@ -0,0 +1,8 @@
1
+ The MIT License (MIT)
2
+ Copyright (c) 2016 Sebastian Burkhard
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5
+
6
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7
+
8
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -4,36 +4,131 @@
4
4
 
5
5
  Or in your Gemfile
6
6
 
7
- gem 'cloudxls', '~> 0.7.0'
7
+ gem 'cloudxls', '~> 2.0.0-beta'
8
8
 
9
- To get started, add the following to your PHP script:
9
+ # Documentation
10
10
 
11
- # Useage
11
+ Additional documentation: [https://docs.cloudxls.com](docs.cloudxls.com)
12
12
 
13
- There are various sample code snippets in the examples folder.
13
+ # Quick Start Guide
14
14
 
15
- ## Async
15
+ ## Set-up API-Keys
16
+
17
+ Register on https://www.cloudxls.com to get an API key.
18
+
19
+ Either set the ENV variable `CLOUDXLS_API_KEY` or manually using `Cloudxls.api_key#=`
16
20
 
17
21
  ```ruby
18
- CloudXLS.api_key = "YOUR-API-KEY"
22
+ Cloudxls.api_key = "YOUR-API-KEY"
23
+ ```
24
+
25
+ ### Sandbox
26
+
27
+ If you use a sandbox API key (starting with 'test_') the client sends requests
28
+ to the sandbox test API.
29
+
30
+ ## Read-API
31
+
32
+ Send an xls or xlsx file using the `Cloudxls#read` method. `#to_h` will start the request and parse the json into a ruby hash.
33
+
34
+ ```ruby
35
+ data = Cloudxls.read(file: File.new("/path/to/my-excel.xls")).to_h
36
+ ```
37
+
38
+ Output
19
39
 
20
- response = CloudXLS.async({
21
- :data => {
22
- :text => "Greeting,Greetee\nHello,World"
40
+ ```json
41
+ [
42
+ {
43
+ "name" : "Sheet1",
44
+ "rows" : [
45
+ ["hello", "world"],
46
+ ["lorem", "ipsum"]
47
+ ]
23
48
  }
24
- })
49
+ ]
50
+ ```
51
+
52
+ From a remote url
53
+
54
+ ```ruby
55
+ data = Cloudxls.read(file_url: "http://example.org/data.xls").to_h
56
+ ```
57
+
58
+ Save json to a file
59
+
60
+ ```ruby
61
+ Cloudxls.read(file: File.new("my-excel.xls"))
62
+ .save_as("output.json")
63
+ ```
64
+
65
+ Or access the response_stream directly
66
+
67
+ ```ruby
68
+ io = File.new("output.json", "w")
69
+ Cloudxls.read(file: File.new("/path/to/my-excel.xls")).each do |chunk|
70
+ io.write chunk
71
+ end
72
+ io.close
73
+ ```
74
+
75
+ ## Write-API
76
+
77
+ Write a xls file with a single sheet.
78
+
79
+ ```ruby
80
+ csv_string = "hello,world\nfoo,bar"
81
+
82
+ Cloudxls.write(csv: csv_string)
83
+ .save_as("/tmp/hello-world.xls")
84
+ ```
85
+
86
+ Write xlsx:
87
+
88
+ ```ruby
89
+ Cloudxls.write(csv: csv_string)
90
+ .as_xlsx
91
+ .save_as("/tmp/hello-world.xlsx")
92
+ ```
93
+
94
+ With options:
25
95
 
26
- redirect_to response.url
96
+ ```ruby
97
+ req = Cloudxls.write(
98
+ csv: csv_string,
99
+ offset: "B2",
100
+ sheet_name: "Data"
101
+ )
102
+ req.save_as("/tmp/hello-world.xls")
27
103
  ```
28
104
 
29
- ## Inline
105
+ Multiple sheets:
30
106
 
31
107
  ```ruby
32
- CloudXLS.api_key = "YOUR-API-KEY"
108
+ Cloudxls.write(csv: csv_string)
109
+ .add_data(csv: "more,data")
110
+ .add_data(csv: "more,data", sheet_name: "foobar")
111
+ .save_as("/tmp/hello-world.xls")
112
+ ```
113
+
114
+ Append data to a excel file (xls or xlsx)
33
115
 
34
- response = CloudXLS.inline(:data => {
35
- :text => "Greeting,Greetee\nHello,World"
36
- })
116
+ ```ruby
117
+ Cloudxls.write(csv: csv_string)
118
+ .target_file(File.new("/path/to/my-file.xls"))
119
+ .save_as("/tmp/hello-world.xls")
120
+ ```
121
+
122
+ ## Useage in Rails
123
+
124
+ The most efficient way is to directly stream the cloudxls response to the client.
125
+ Assign the result of a `#write` or `#read` call to the `response_body`.
126
+
127
+ ```ruby
128
+ def index
129
+ headers["Content-Type"] = "application/vnd.ms-excel"
130
+ headers["Content-disposition"] = "attachment; filename=users.xls"
37
131
 
38
- File.open("report.xls", 'wb') {|f| f << response }
132
+ self.response_body = Cloudxls.write(csv: User.all.to_csv)
133
+ end
39
134
  ```
data/Rakefile CHANGED
@@ -1,17 +1,8 @@
1
1
  task :default => [:test]
2
2
 
3
- task :test do
4
- ret = true
5
- Dir["test/**/*.rb"].each do |f|
6
- ret = ret && ruby(f, '')
7
- end
8
- exit(ret)
9
- end
3
+ require 'rake/testtask'
10
4
 
11
- task :cloudxls_console do
12
- require 'irb'
13
- require 'irb/completion'
14
- require './lib/cloudxls' # You know what to do.
15
- ARGV.clear
16
- IRB.start
5
+ Rake::TestTask.new do |t|
6
+ t.libs << 'test'
7
+ t.pattern = "test/*_test.rb"
17
8
  end
data/cloudxls.gemspec CHANGED
@@ -5,19 +5,19 @@ require "cloudxls/version"
5
5
  Gem::Specification.new do |gem|
6
6
  gem.name = "cloudxls"
7
7
  gem.authors = ["Sebastian Burkhard"]
8
- gem.email = ["seb@cloudxls.com"]
9
- gem.description = %q{Ruby wrapper for the CloudXLS xpipe API}
10
- gem.summary = %q{Ruby wrapper for the CloudXLS xpipe API}
8
+ gem.email = ["hello@cloudxls.com"]
9
+ gem.description = %q{Ruby wrapper to read and write Excel through the cloudxls API.}
10
+ gem.summary = %q{Ruby wrapper to read and write Excel through the cloudxls API.}
11
11
  gem.homepage = "https://cloudxls.com"
12
12
  gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
13
13
  gem.files = `git ls-files`.split("\n")
14
14
  gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
15
15
  gem.require_paths = ["lib"]
16
- gem.version = CloudXLS::VERSION
17
16
 
18
- gem.add_dependency('rest-client', '~> 1.4')
17
+ gem.version = Cloudxls::VERSION
18
+
19
+ gem.add_dependency('multipart-post', '~> 2.0.0')
19
20
 
20
21
  gem.add_development_dependency "minitest"
21
22
  gem.add_development_dependency "rake"
22
- gem.add_development_dependency "rspec"
23
23
  end
data/lib/cloudxls.rb CHANGED
@@ -1,150 +1,216 @@
1
- require 'cgi'
2
- require 'set'
3
1
  require 'openssl'
4
2
  require 'json'
5
- require 'date'
6
- require 'rest_client'
7
- require 'json'
8
-
9
- require_relative 'cloudxls/version'
3
+ require 'net/http'
4
+ require 'net/http/post/multipart'
10
5
 
11
- class CloudXLS
12
- @https = true
13
- @api_base = 'api.cloudxls.com'.freeze
14
- @api_key = ENV["CLOUDXLS_API_KEY"]
15
6
 
16
- class << self
17
- attr_accessor :api_key, :api_base, :api_version, :https
7
+ class Cloudxls
8
+ class ApiError < Exception
18
9
  end
19
10
 
20
- def self.api_url(path = '')
21
- # @api_base + url
22
- "http#{@https ? 's' : ''}://#{@api_key}:@#{@api_base}/v1/#{path}"
23
- end
11
+ @api_key = ENV.fetch("CLOUDXLS_API_KEY", nil)
12
+ @api_base = ENV.fetch("CLOUDXLS_API_BASE", "api.cloudxls.com")
13
+ @sandbox_base = "sandbox.cloudxls.com"
14
+ @api_version = "v2".freeze
24
15
 
16
+ class << self
17
+ attr_accessor :api_key,
18
+ :api_version,
19
+ :api_base,
20
+ :sandbox_base,
21
+ :port
22
+
23
+ def client_options
24
+ {
25
+ api_key: self.api_key,
26
+ api_version: self.api_version,
27
+ api_base: self.api_base,
28
+ port: 443
29
+ }
30
+ end
25
31
 
26
- class CloudXLSResponse
27
- attr_reader :url, :uuid, :response
32
+ def write(params = nil, client_options = nil)
33
+ Write.new(client_options).add_data(params)
34
+ end
28
35
 
29
- def initialize(response)
30
- data = CloudXLS.parse_response(response)
31
- @response = response
32
- @url = data['url']
33
- @uuid = data['uuid']
36
+ def read(params = nil, client_options = nil)
37
+ Read.new(client_options).add_data(params)
34
38
  end
35
39
  end
36
40
 
41
+ module BaseRequest
42
+ def initialize(client_options = nil)
43
+ @post_data = []
37
44
 
38
- def self.async(params = {})
39
- if params["mode"]
40
- params["mode"] = "async"
41
- else
42
- params[:mode] = "async"
45
+ @finished = false
46
+ @client_options = client_options || Cloudxls.client_options
47
+ end
48
+
49
+ def api_key
50
+ key = client_options[:api_key]
51
+ if key.nil?
52
+ raise "api_key is nil. Configure using CLOUDXLS_API_KEY ENV variable or Cloudxls.api_key = ..."
53
+ end
54
+ key
43
55
  end
44
- CloudXLSResponse.new(convert(params))
45
- end
46
56
 
57
+ def test_key?
58
+ api_key.to_s.downcase.start_with?("test")
59
+ end
47
60
 
48
- def self.inline(params = {})
49
- if params["mode"]
50
- params["mode"] = "inline"
51
- else
52
- params[:mode] = "inline"
61
+ def api_base
62
+ if test_key?
63
+ Cloudxls.sandbox_base
64
+ else
65
+ client_options[:api_base]
66
+ end
53
67
  end
54
- convert(params)
55
- end
56
68
 
69
+ def start(&block)
70
+ Net::HTTP.start(api_base, client_options[:port], use_ssl: true, &block)
71
+ end
57
72
 
58
- # @example
59
- # CloudXLS.convert :data => {:file => File.new('/path/to/data.csv', 'r')}
60
- # CloudXLS.convert :data => {:file => File.new("foo,bar\nlorem,ipsum") }
61
- # CloudXLS.convert :data => {:url => "https://example.com/data.csv"}
62
- # CloudXLS.convert :data => {:url => "https://username:password@example.com/data.csv"}
63
- #
64
- def self.convert(params = {})
65
- check_api_key!
73
+ def path_to(path)
74
+ "/#{client_options[:api_version]}/#{path}"
75
+ end
66
76
 
67
- headers = {}
77
+ def data
78
+ each
79
+ end
68
80
 
69
- response = execute_request do
70
- RestClient.post(api_url("convert"), params, headers)
81
+ def write_to(io)
82
+ each do |chunk|
83
+ io.write chunk
84
+ end
85
+ io
86
+ ensure
87
+ io.close
71
88
  end
72
89
 
73
- response
74
- end
90
+ def save_as(path)
91
+ write_to File.open(path, 'wb')
92
+ end
75
93
 
76
- # @deprecated
77
- def self.xpipe(params = {})
78
- convert(params)
94
+ def each(&block)
95
+ raise "#{self.class.name} already executed" if @finished
96
+
97
+ start do |http|
98
+ request = Net::HTTP::Post::Multipart.new(self.path, @post_data)
99
+ request.basic_auth api_key, ""
100
+ request['User-Agent'] = "cloudxls-ruby #{Cloudxls::VERSION}"
101
+
102
+ if block_given?
103
+ http.request(request) do |response|
104
+ if Net::HTTPSuccess === response
105
+ response.read_body(&block)
106
+ else
107
+ raise ApiError.new("#{response.code} #{response.class.name.to_s}: #{response.body}")
108
+ end
109
+ end
110
+ else
111
+ http.request(request)
112
+ end
113
+ end
114
+ @finished = true
115
+ self
116
+ end
79
117
  end
80
118
 
81
- def self.execute_request
82
- begin
83
- return yield
84
- rescue SocketError => e
85
- handle_restclient_error(e)
86
- rescue NoMethodError => e
87
- # Work around RestClient bug
88
- if e.message =~ /\WRequestFailed\W/
89
- e = APIConnectionError.new('Unexpected HTTP response code')
90
- handle_restclient_error(e)
91
- else
92
- raise
119
+ class Read
120
+ include BaseRequest
121
+
122
+ # post_data is an array of key,value arrays. Reason:
123
+ # - A key can appear multiple times (for multiple sheets)
124
+ # - Parameters need to be in the right order: template - config - data
125
+ #
126
+ # Example: [["separator", ","], ["csv", "hello,world"]]
127
+ attr_reader :post_data
128
+ attr_reader :client_options
129
+
130
+ DATA_PARAMETERS = %w[excel file]
131
+
132
+ def add_data(params)
133
+ params.map do |key,value|
134
+ key = key.to_s
135
+ if DATA_PARAMETERS.include?(key)
136
+ value = UploadIO.new(value, "text/csv", "data.csv")
137
+ end
138
+ @post_data << [key, value]
93
139
  end
94
- rescue RestClient::ExceptionWithResponse => e
95
- if rcode = e.http_code and rbody = e.http_body
96
- # TODO
97
- # handle_api_error(rcode, rbody)
98
- handle_restclient_error(e)
99
- else
100
- handle_restclient_error(e)
140
+ self
141
+ end
142
+
143
+ def response_body
144
+ # TODO: optimize
145
+ str = ""
146
+ each do |chunk|
147
+ str << chunk
101
148
  end
102
- rescue RestClient::Exception, Errno::ECONNREFUSED => e
103
- handle_restclient_error(e)
149
+ str
104
150
  end
105
- end
106
151
 
107
- def self.parse_response(response)
108
- json = JSON.parse(response.body)
109
- rescue => e
110
- raise general_api_error(response.code, response.body)
111
- end
152
+ def to_h
153
+ JSON.load(response_body)
154
+ end
112
155
 
113
- def self.general_api_error(rcode, rbody)
114
- StandardError.new("Invalid response object from API: #{rbody.inspect} " +
115
- "(HTTP response code was #{rcode})" ) #, rcode, rbody)
116
- end
156
+ protected
117
157
 
158
+ def path
159
+ path_to("read.json")
160
+ end
161
+ end
118
162
 
163
+ class Write
164
+ include BaseRequest
165
+ # post_data is an array of key,value arrays. Reason:
166
+ # - A key can appear multiple times (for multiple sheets)
167
+ # - Parameters need to be in the right order: template - config - data
168
+ #
169
+ # Example: [["separator", ","], ["csv", "hello,world"]]
170
+ attr_reader :post_data
171
+ attr_reader :client_options
172
+
173
+ attr_accessor :file_format
174
+
175
+ DATA_PARAMETERS = %w[data data_url csv csv_url json json_url]
176
+
177
+ def add_data(params = nil)
178
+ data_params = []
179
+ params.each do |key, value|
180
+ key = key.to_s
181
+ if DATA_PARAMETERS.include?(key)
182
+ data_params << [key, value]
183
+ else
184
+ @post_data << [key, value]
185
+ end
186
+ end
187
+ @post_data += data_params
188
+ self
189
+ end
119
190
 
120
- private
121
- def self.handle_restclient_error(e)
122
- case e
123
- when RestClient::ServerBrokeConnection, RestClient::RequestTimeout
124
- message = "Could not connect to CloudXLS (#{@api_base}). " +
125
- "Please check your internet connection and try again. "
126
- when RestClient::SSLCertificateNotVerified
127
- message = "Could not verify CloudXLS's SSL certificate. " +
128
- "Please make sure that your network is not intercepting certificates. "
129
- when SocketError
130
- message = "Unexpected error communicating when trying to connect to CloudXLS. " +
131
- "You may be seeing this message because your DNS is not working. " +
132
- "To check, try running 'host cloudxls.com' from the command line."
133
- else
134
- message = "Unexpected error communicating with CloudXLS. " +
135
- "If this problem persists, let us know at support@cloudxls.com."
191
+ def as_xls
192
+ self.file_format = "xls"
193
+ self
136
194
  end
137
195
 
138
- raise StandardError.new(message + "\n\n(Network error: #{e.message})")
139
- end
196
+ def as_xlsx
197
+ self.file_format = "xlsx"
198
+ self
199
+ end
140
200
 
141
- def self.check_api_key!
142
- unless api_key ||= @api_key
143
- raise StandardError.new('No API key provided. Set your API key using "CloudXLS.api_key = <API-KEY>". ')
201
+ def append_to(target_file)
202
+ @post_data = [["target_file", target_file]] + @post_data
203
+ self
144
204
  end
145
205
 
146
- if api_key =~ /\s/
147
- raise StandardError.new('Your API key is invalid, as it contains whitespace.')
206
+ protected
207
+
208
+ def path
209
+ if file_format
210
+ path_to("write.#{file_format}")
211
+ else
212
+ path_to("write")
213
+ end
148
214
  end
149
215
  end
150
216
 
@@ -1,3 +1,3 @@
1
- class CloudXLS
2
- VERSION = '0.7.0'
1
+ class Cloudxls
2
+ VERSION = '2.0.0-beta'
3
3
  end
@@ -0,0 +1,22 @@
1
+ require 'test_helper'
2
+
3
+ class CloudxlsTest < Minitest::Test
4
+ def test_defaults
5
+ Cloudxls.api_key = "test_foo"
6
+ file = Cloudxls.write(csv: "hello,world").save_as("/tmp/foo.xls")
7
+ hash = Cloudxls.read(excel: File.new(file.path)).to_h
8
+ assert_equal ["hello", "world"], hash.first["rows"][0]
9
+ end
10
+
11
+ def test_accessors
12
+ Cloudxls.api_key = "test_foo"
13
+ assert_equal "test_foo", Cloudxls.api_key
14
+
15
+ Cloudxls.api_base = "sandbox.cloudxls.com"
16
+ assert_equal "sandbox.cloudxls.com", Cloudxls.api_host
17
+ end
18
+
19
+ def test_test_api_keys
20
+ Cloudxls::Write.new(api_key: "test_foobar")
21
+ end
22
+ end
@@ -0,0 +1,2 @@
1
+ require 'cloudxls'
2
+ require 'minitest/autorun'
metadata CHANGED
@@ -1,89 +1,67 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudxls
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
5
- prerelease:
4
+ version: 2.0.0.pre.beta
6
5
  platform: ruby
7
6
  authors:
8
7
  - Sebastian Burkhard
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-02-21 00:00:00.000000000 Z
11
+ date: 2016-07-20 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
- name: rest-client
14
+ name: multipart-post
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ~>
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
- version: '1.4'
19
+ version: 2.0.0
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ~>
24
+ - - "~>"
28
25
  - !ruby/object:Gem::Version
29
- version: '1.4'
26
+ version: 2.0.0
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: minitest
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - ">="
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - ">="
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rake
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - ">="
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - ">="
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
- - !ruby/object:Gem::Dependency
63
- name: rspec
64
- requirement: !ruby/object:Gem::Requirement
65
- none: false
66
- requirements:
67
- - - ! '>='
68
- - !ruby/object:Gem::Version
69
- version: '0'
70
- type: :development
71
- prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
75
- - - ! '>='
76
- - !ruby/object:Gem::Version
77
- version: '0'
78
- description: Ruby wrapper for the CloudXLS xpipe API
55
+ description: Ruby wrapper to read and write Excel through the cloudxls API.
79
56
  email:
80
- - seb@cloudxls.com
57
+ - hello@cloudxls.com
81
58
  executables: []
82
59
  extensions: []
83
60
  extra_rdoc_files: []
84
61
  files:
85
- - .gitignore
62
+ - ".gitignore"
86
63
  - Gemfile
64
+ - LICENSE
87
65
  - README.md
88
66
  - Rakefile
89
67
  - cloudxls.gemspec
@@ -98,33 +76,31 @@ files:
98
76
  - examples/templates.rb
99
77
  - lib/cloudxls.rb
100
78
  - lib/cloudxls/version.rb
101
- - lib/data/ca-certificates.txt
102
- - spec/cloudxls_spec.rb
103
- - spec/spec_helper.rb
79
+ - test/cloudxls_test.rb
80
+ - test/test_helper.rb
104
81
  homepage: https://cloudxls.com
105
82
  licenses: []
83
+ metadata: {}
106
84
  post_install_message:
107
85
  rdoc_options: []
108
86
  require_paths:
109
87
  - lib
110
88
  required_ruby_version: !ruby/object:Gem::Requirement
111
- none: false
112
89
  requirements:
113
- - - ! '>='
90
+ - - ">="
114
91
  - !ruby/object:Gem::Version
115
92
  version: '0'
116
93
  required_rubygems_version: !ruby/object:Gem::Requirement
117
- none: false
118
94
  requirements:
119
- - - ! '>='
95
+ - - ">"
120
96
  - !ruby/object:Gem::Version
121
- version: '0'
97
+ version: 1.3.1
122
98
  requirements: []
123
99
  rubyforge_project:
124
- rubygems_version: 1.8.23
100
+ rubygems_version: 2.5.1
125
101
  signing_key:
126
- specification_version: 3
127
- summary: Ruby wrapper for the CloudXLS xpipe API
102
+ specification_version: 4
103
+ summary: Ruby wrapper to read and write Excel through the cloudxls API.
128
104
  test_files:
129
- - spec/cloudxls_spec.rb
130
- - spec/spec_helper.rb
105
+ - test/cloudxls_test.rb
106
+ - test/test_helper.rb
File without changes
@@ -1,20 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "CloudXLS" do
4
- before do
5
-
6
- end
7
-
8
- describe "CloudXLS.api_key" do
9
- it "should not register api_key" do
10
- CloudXLS.api_key = "FOO"
11
- expect( CloudXLS.api_key ).to eq("FOO")
12
- end
13
-
14
- it "should not register api_key" do
15
- CloudXLS.api_key = "FOO"
16
- CloudXLS.api_key = "BAR"
17
- expect( CloudXLS.api_key ).to eq("BAR")
18
- end
19
- end
20
- end
data/spec/spec_helper.rb DELETED
@@ -1,10 +0,0 @@
1
- ENV["RAILS_ENV"] = 'test'
2
- require 'bundler'
3
- require 'bundler/setup'
4
- require 'cloudxls'
5
-
6
-
7
- RSpec.configure do |config|
8
- config.color_enabled = true
9
- config.order = "random"
10
- end