saxlsx 1.9.0 → 1.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/ruby.yml +20 -0
- data/Gemfile +1 -7
- data/README.md +15 -17
- data/lib/saxlsx/version.rb +1 -1
- data/lib/saxlsx/workbook.rb +2 -2
- data/saxlsx.gemspec +6 -5
- data/spec/benchmarks.rb +13 -8
- data/spec/sheet_spec.rb +3 -3
- data/spec/spec_helper.rb +3 -1
- metadata +30 -17
- data/.travis.yml +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: c3afefeef02ae14dd48aa941f1fdf2f6e5a755da29f8622df662192c2f0769f6
|
4
|
+
data.tar.gz: 035a0b22f8c8939e2cd5b2969137390ce619a56dc9b64a1eb09b11cfe83213a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e90042ca8ad55328930d2236ac8a114974302e9234be00a9f29c932b73b877fa040f7d874aab251b64979d97f90353d89b6fdfdd6f4bbba23efa136add45cd5
|
7
|
+
data.tar.gz: 5e7cd78028bac896e1ac41eef735328c05a0da2351aa8bdc46f224d827a296e6ff52eda383826feaec1d42556b6793a516df50aa5bdcf4a2e80f4d867cea4520
|
@@ -0,0 +1,20 @@
|
|
1
|
+
name: Ruby
|
2
|
+
|
3
|
+
on: [push, pull_request]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
test:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
strategy:
|
9
|
+
matrix:
|
10
|
+
ruby-version: ['2.5', '2.6', '2.7', '3.0']
|
11
|
+
|
12
|
+
steps:
|
13
|
+
- uses: actions/checkout@v2
|
14
|
+
- name: Set up Ruby
|
15
|
+
uses: ruby/setup-ruby@v1
|
16
|
+
with:
|
17
|
+
ruby-version: ${{ matrix.ruby-version }}
|
18
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
19
|
+
- name: Run tests
|
20
|
+
run: bundle exec rake
|
data/Gemfile
CHANGED
@@ -3,10 +3,4 @@ source 'https://rubygems.org'
|
|
3
3
|
# Specify your gem's dependencies in saxlsx.gemspec
|
4
4
|
gemspec
|
5
5
|
|
6
|
-
gem
|
7
|
-
gem 'rubyXL', github: 'weshatheleopard/rubyXL'
|
8
|
-
gem 'simple_xlsx_reader', github: 'woahdae/simple_xlsx_reader'
|
9
|
-
gem 'creek', github: 'pythonicrubyist/creek'
|
10
|
-
gem 'oxcelix', github: 'gbiczo/oxcelix'
|
11
|
-
gem 'roo', github: 'roo-rb/roo'
|
12
|
-
gem 'dullard', github: 'thirtyseven/dullard'
|
6
|
+
gem "rubyzip", "~> 2.0"
|
data/README.md
CHANGED
@@ -2,8 +2,6 @@
|
|
2
2
|
|
3
3
|
[![Join the chat at https://gitter.im/mak-it/saxlsx](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mak-it/saxlsx?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
4
4
|
|
5
|
-
[![Build Status](https://travis-ci.org/mak-it/saxlsx.svg?branch=master)](https://travis-ci.org/mak-it/saxlsx)
|
6
|
-
|
7
5
|
**Fast** and memory efficient XLSX reader on top of Ox SAX parser.
|
8
6
|
|
9
7
|
It reads row by row and doesn't store the whole sheet in memory, so this
|
@@ -52,30 +50,30 @@ using `auto_format: false`.
|
|
52
50
|
$ rake bench
|
53
51
|
```
|
54
52
|
|
55
|
-
ruby 2.
|
53
|
+
ruby 2.7 on OS X
|
56
54
|
|
57
55
|
```
|
58
56
|
Shared Strings
|
59
57
|
|
60
58
|
user system total real
|
61
|
-
creek
|
62
|
-
dullard 1.
|
63
|
-
oxcelix
|
64
|
-
roo
|
65
|
-
rubyXL
|
66
|
-
saxlsx 0.
|
67
|
-
simple_xlsx_reader 1.
|
59
|
+
creek 1.296539 0.029374 1.325913 ( 1.340820)
|
60
|
+
dullard 1.178981 0.025073 1.204054 ( 1.221381)
|
61
|
+
oxcelix 0.985258 0.025028 1.010286 ( 1.023730)
|
62
|
+
roo 0.971155 0.029964 1.001119 ( 1.016452)
|
63
|
+
rubyXL 2.979334 0.055708 3.035042 ( 3.079301)
|
64
|
+
saxlsx 0.473398 0.011342 0.484740 ( 0.490247)
|
65
|
+
simple_xlsx_reader 1.209074 0.024579 1.233653 ( 1.249957)
|
68
66
|
|
69
67
|
Inline Strings
|
70
68
|
|
71
69
|
user system total real
|
72
|
-
creek
|
73
|
-
dullard
|
74
|
-
oxcelix
|
75
|
-
roo
|
76
|
-
rubyXL 3.
|
77
|
-
saxlsx 0.
|
78
|
-
simple_xlsx_reader 1.
|
70
|
+
creek 1.471115 0.075182 1.546297 ( 1.567045)
|
71
|
+
dullard 1.338499 0.085116 1.423615 ( 1.443386)
|
72
|
+
oxcelix ERROR
|
73
|
+
roo 1.133878 0.052834 1.186712 ( 1.208369)
|
74
|
+
rubyXL 3.213630 0.070255 3.283885 ( 3.324428)
|
75
|
+
saxlsx 0.667601 0.024265 0.691866 ( 0.696603)
|
76
|
+
simple_xlsx_reader 1.350298 0.028411 1.378709 ( 1.396583)
|
79
77
|
```
|
80
78
|
|
81
79
|
## Contributing
|
data/lib/saxlsx/version.rb
CHANGED
data/lib/saxlsx/workbook.rb
CHANGED
@@ -7,9 +7,9 @@ module Saxlsx
|
|
7
7
|
attr_accessor :date1904
|
8
8
|
attr_reader :auto_format
|
9
9
|
|
10
|
-
def self.open(
|
10
|
+
def self.open(filename, **kw_args)
|
11
11
|
begin
|
12
|
-
workbook =
|
12
|
+
workbook = new(filename, **kw_args)
|
13
13
|
yield workbook
|
14
14
|
ensure
|
15
15
|
workbook.close if workbook
|
data/saxlsx.gemspec
CHANGED
@@ -18,13 +18,14 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^spec/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.required_ruby_version = '>= 2.
|
21
|
+
spec.required_ruby_version = '>= 2.5.0'
|
22
22
|
|
23
|
-
spec.add_dependency 'rubyzip', '
|
23
|
+
spec.add_dependency 'rubyzip', '>= 1.0'
|
24
24
|
spec.add_dependency 'ox', '~> 2.1'
|
25
25
|
|
26
|
-
spec.add_development_dependency 'bundler', "
|
27
|
-
spec.add_development_dependency 'rake', '~>
|
28
|
-
spec.add_development_dependency 'rspec', '~>
|
26
|
+
spec.add_development_dependency 'bundler', ">= 1.5"
|
27
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
28
|
+
spec.add_development_dependency 'rspec', '~> 3.10'
|
29
|
+
spec.add_development_dependency 'rspec-collection_matchers'
|
29
30
|
spec.add_development_dependency 'simplecov', '~> 0.8'
|
30
31
|
end
|
data/spec/benchmarks.rb
CHANGED
@@ -1,13 +1,18 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
require 'benchmark'
|
3
|
-
require '
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
3
|
+
require 'bundler/inline'
|
4
|
+
|
5
|
+
gemfile do
|
6
|
+
source 'https://rubygems.org'
|
7
|
+
gem 'caxlsx'
|
8
|
+
gem 'rubyXL'
|
9
|
+
gem 'simple_xlsx_reader'
|
10
|
+
gem 'creek'
|
11
|
+
gem 'oxcelix'
|
12
|
+
gem 'roo'
|
13
|
+
gem 'dullard'
|
14
|
+
gem "saxlsx", path: File.expand_path("../..", __FILE__ )
|
15
|
+
end
|
11
16
|
|
12
17
|
module Saxlsx
|
13
18
|
class Benchmarks
|
data/spec/sheet_spec.rb
CHANGED
@@ -36,7 +36,7 @@ describe Sheet do
|
|
36
36
|
3,
|
37
37
|
DateTime.new(2013, 12, 13, 8, 0, 58),
|
38
38
|
DateTime.new(1970, 1, 1),
|
39
|
-
BigDecimal
|
39
|
+
BigDecimal('3.4028236692093801E+38'),
|
40
40
|
DateTime.new(2015, 2, 13, 12, 40, 5)
|
41
41
|
]
|
42
42
|
s.rows[1].should eq [
|
@@ -175,7 +175,7 @@ describe Sheet do
|
|
175
175
|
["Time", DateTime.new(2015, 2, 13, 12, 40, 5)],
|
176
176
|
["Percentage", 0.9999],
|
177
177
|
["Fraction", 0.5],
|
178
|
-
["Scientific", BigDecimal
|
178
|
+
["Scientific", BigDecimal('3.4028236692093801E+38')],
|
179
179
|
["Custom", 123.0],
|
180
180
|
].each.with_index do |row, i|
|
181
181
|
name, value = row
|
@@ -202,7 +202,7 @@ describe Sheet do
|
|
202
202
|
["Time", DateTime.new(2015, 2, 13, 12, 40, 5)],
|
203
203
|
["Percentage", 0.9999],
|
204
204
|
["Fraction", 0.5],
|
205
|
-
["Scientific", BigDecimal
|
205
|
+
["Scientific", BigDecimal('3.4028236692093801E+38')],
|
206
206
|
["Custom", 123.0],
|
207
207
|
].each.with_index do |row, i|
|
208
208
|
name, value = row
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: saxlsx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Edgars Beigarts
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-11-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyzip
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
@@ -42,14 +42,14 @@ dependencies:
|
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '1.5'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.5'
|
55
55
|
- !ruby/object:Gem::Dependency
|
@@ -58,28 +58,42 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '13.0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '13.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '3.10'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '3.10'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rspec-collection_matchers
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: simplecov
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -102,8 +116,8 @@ executables:
|
|
102
116
|
extensions: []
|
103
117
|
extra_rdoc_files: []
|
104
118
|
files:
|
119
|
+
- ".github/workflows/ruby.yml"
|
105
120
|
- ".gitignore"
|
106
|
-
- ".travis.yml"
|
107
121
|
- Gemfile
|
108
122
|
- LICENSE.txt
|
109
123
|
- README.md
|
@@ -143,7 +157,7 @@ homepage: https://github.com/mak-it/saxlsx
|
|
143
157
|
licenses:
|
144
158
|
- MIT
|
145
159
|
metadata: {}
|
146
|
-
post_install_message:
|
160
|
+
post_install_message:
|
147
161
|
rdoc_options: []
|
148
162
|
require_paths:
|
149
163
|
- lib
|
@@ -151,16 +165,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
151
165
|
requirements:
|
152
166
|
- - ">="
|
153
167
|
- !ruby/object:Gem::Version
|
154
|
-
version: 2.
|
168
|
+
version: 2.5.0
|
155
169
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
156
170
|
requirements:
|
157
171
|
- - ">="
|
158
172
|
- !ruby/object:Gem::Version
|
159
173
|
version: '0'
|
160
174
|
requirements: []
|
161
|
-
|
162
|
-
|
163
|
-
signing_key:
|
175
|
+
rubygems_version: 3.1.4
|
176
|
+
signing_key:
|
164
177
|
specification_version: 4
|
165
178
|
summary: Fast xlsx reader on top of Ox SAX parser
|
166
179
|
test_files:
|