excel-esv 3.0.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: '091fb26ba128c0aa7edfb4626b5352932f5cd687'
4
- data.tar.gz: 19a2ce71dff87da35950c2565c4e3f14356ccf7e
2
+ SHA256:
3
+ metadata.gz: bb907e9f6b481001f01561df298d6052f3efb37f4ae3f57191b2bb807699203e
4
+ data.tar.gz: ea18830fa510acd5fe6d204714fbfc75114c0e167d08bd3fa969b61406893bf2
5
5
  SHA512:
6
- metadata.gz: f5d61d2edd87c497fe58009ee373becca121ba5bbba4da5af46dbc2974bfede3a8f54c7d2cb25c60511c9557e12dfdb1d8912c2fb305e600c1951b4982154b19
7
- data.tar.gz: d16b94bce839a3962cde843c50af7047c142a4c4f8f23d991a657ed6cd603dbfb799a162fe6c095048ded07c10ac0a6675f378f83f584f3a82b64d02e10731b9
6
+ metadata.gz: 745103dd2cbf9eda28e2d2947f4785b6a3f95372be9c3044265029cb4ac2e01c16d943923cb6e3f677387b2dfc6b5cbaba6bfddab001c0e775c97a92e967870b
7
+ data.tar.gz: e22bb76f26d291021847496fd679f6f982c4ecd14f0e9978674f08607f90d848b9539d5931d0a1ae038af8c22a8254814e69198af1802f755960e2fc0394ece4
@@ -0,0 +1,6 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "github-actions"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
@@ -0,0 +1,32 @@
1
+ name: Ruby CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ ruby-versions:
11
+ uses: ruby/actions/.github/workflows/ruby_versions.yml@master
12
+ with:
13
+ min_version: 3.2
14
+ engine: cruby
15
+
16
+ test:
17
+ needs: ruby-versions
18
+ runs-on: ubuntu-latest
19
+
20
+ strategy:
21
+ matrix:
22
+ ruby-version: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
23
+
24
+ steps:
25
+ - uses: actions/checkout@v5
26
+ - name: Set up Ruby ${{ matrix.ruby-version }}
27
+ uses: ruby/setup-ruby@v1
28
+ with:
29
+ ruby-version: ${{ matrix.ruby-version }}
30
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
31
+ - name: Run tests
32
+ run: bundle exec rake
data/.gitignore CHANGED
@@ -11,4 +11,5 @@
11
11
  *.so
12
12
  *.o
13
13
  *.a
14
+ *.gem
14
15
  mkmf.log
data/.rubocop.yml ADDED
@@ -0,0 +1,5 @@
1
+ AllCops:
2
+ Exclude:
3
+ - "tmp/**/*"
4
+ inherit_gem:
5
+ barsoom_utils: shared_rubocop.yml
data/CHANGELOG.md CHANGED
@@ -1,12 +1,24 @@
1
- # 3.0.0
1
+ # Changelog
2
+
3
+ ## 3.1.0 (Nov 12, 2025)
4
+
5
+ * Support specifying worksheet index when there are multiple: `ESV.parse(data, worksheet_index: 0)`.
6
+
7
+ ## 3.0.1 (Nov 19, 2021)
8
+
9
+ * Add `ESV.parse(data, header_converters:)` [#9]
10
+
11
+ [#9]: https://github.com/barsoom/excel-esv/pull/9
12
+
13
+ ## 3.0.0 (Nov 20, 2018)
2
14
 
3
15
  * Returns the last value of any formula cells instead of returning a `Spreadsheet::Formula`.
4
16
  * Returns the URL of any link cells instead of returning a `Spreadsheet::Link`.
5
17
 
6
- # 2.0.0
18
+ ## 2.0.0 (Nov 19, 2018)
7
19
 
8
20
  * `parse` now returns an actual nested `Array`, not array-like `Spreadsheet::Row` records.
9
21
 
10
- # 1.0.0
22
+ ## 1.0.0 (Dec 8, 2017)
11
23
 
12
24
  * `send_excel` now supports a `filename:` argument, e.g. `send_excel(data, filename: "salaries.xls")`.
data/Gemfile CHANGED
@@ -1,4 +1,12 @@
1
- source 'https://rubygems.org'
1
+ source "https://rubygems.org"
2
2
 
3
- # Specify your gem's dependencies in esv.gemspec
3
+ # Specify your gem's dependencies in excel-esv.gemspec
4
4
  gemspec
5
+
6
+ group :development do
7
+ gem "barsoom_utils"
8
+ gem "bundler"
9
+ gem "rake"
10
+ gem "rspec"
11
+ gem "rubocop"
12
+ end
data/README.md CHANGED
@@ -45,7 +45,31 @@ output = ESV.parse(data)
45
45
  # => [ [ "Name", "Dogs", … ], … ]
46
46
  ```
47
47
 
48
- This assumes a file with a single worksheet and will raise otherwise.
48
+ This will raise for a file with multiple worksheets unless you explicitly specify the one you want (the first worksheet is index 0):
49
+
50
+ ``` ruby
51
+ ESV.parse(data, worksheet_index: 0)
52
+ ```
53
+
54
+ `.parse` supports the `header_converters:` keyword argument, which takes the same arguments as `CSV.parse` does:
55
+
56
+ - a Symbol name for a registered header converter
57
+ - a Proc which takes the value and returns the converted value
58
+ - an Array of Symbol names for registered header converters
59
+
60
+ ``` ruby
61
+ require "esv"
62
+
63
+ data = File.read("/tmp/test.xls")
64
+ output = ESV.parse(data, header_converters: :symbol)
65
+ # => [ [ :name, :dogs, … ], … ]
66
+ ```
67
+
68
+ Registering a new converter:
69
+
70
+ ``` ruby
71
+ ESV::HEADER_CONVERTERS[:upcase] = ->(value) { value.upcase }
72
+ ```
49
73
 
50
74
  ### Parse file
51
75
 
@@ -58,6 +82,8 @@ output = ESV.parse_file("/tmp/test.xls")
58
82
 
59
83
  This assumes a file with a single worksheet and will raise otherwise.
60
84
 
85
+ Also supports `header_converters:`.
86
+
61
87
  ### Generate in Ruby on Rails
62
88
 
63
89
  In `config/initializers/mime_types.rb`:
data/Rakefile CHANGED
@@ -3,4 +3,4 @@ require "rspec/core/rake_task"
3
3
 
4
4
  RSpec::Core::RakeTask.new(:spec)
5
5
 
6
- task :default => :spec
6
+ task default: :spec
data/excel-esv.gemspec CHANGED
@@ -1,24 +1,21 @@
1
1
  # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
2
+ lib = File.expand_path("../lib", __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'esv/version'
4
+ require "esv/version"
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "excel-esv"
8
8
  spec.version = ESV::VERSION
9
- spec.authors = ["Henrik Nyh"]
10
- spec.email = ["henrik@nyh.se"]
9
+ spec.authors = [ "Henrik Nyh" ]
10
+ spec.email = [ "henrik@nyh.se" ]
11
11
  spec.summary = %q{Excel parsing and generation with the ease of CSV.}
12
12
  spec.homepage = "https://github.com/barsoom/excel-esv"
13
13
  spec.license = "MIT"
14
+ spec.metadata = { "rubygems_mfa_required" => "true" }
14
15
 
15
16
  spec.files = `git ls-files -z`.split("\x0")
16
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
- spec.require_paths = ["lib"]
17
+ spec.require_paths = [ "lib" ]
19
18
 
20
- spec.add_dependency "spreadsheet"
21
- spec.add_development_dependency "bundler", "~> 1.7"
22
- spec.add_development_dependency "rake", "~> 10.0"
23
- spec.add_development_dependency "rspec"
19
+ spec.add_runtime_dependency "spreadsheet"
20
+ spec.add_runtime_dependency "logger"
24
21
  end
data/lib/esv/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module ESV
2
- VERSION = "3.0.0"
2
+ VERSION = "3.1.0"
3
3
  end
data/lib/esv.rb CHANGED
@@ -16,27 +16,78 @@ module ESV
16
16
  end
17
17
  end
18
18
 
19
- def self.parse(data)
19
+ # You can register your own header converters in this Hash.
20
+ #
21
+ # @see https://rubyapi.org/3.2/o/csv#class-CSV-label-Custom+Header+Converters
22
+ HEADER_CONVERTERS = {
23
+ downcase: ->(value) {
24
+ value.respond_to?(:downcase) ? value.downcase : value
25
+ },
26
+ # Details:
27
+ #
28
+ # Strips leading and trailing whitespace.
29
+ # Downcases the header.
30
+ # Replaces embedded spaces with underscores.
31
+ # Removes non-word characters.
32
+ # Makes the string into a Symbol.
33
+ symbol: ->(value) {
34
+ value.to_s.strip.downcase.tr(" ", "_").gsub(/\W+/, "").to_sym
35
+ },
36
+ }
37
+
38
+ # @param data [Object] Spreadsheet data to be parsed.
39
+ # @param header_converters [nil, Symbol, Proc, Array<Symbol>] If given, can take these forms:
40
+ # - a Symbol name for a registered header converter
41
+ # - a Proc which takes the value and returns the converted value
42
+ # - an Array of Symbol names for registered header converters
43
+ # @param worksheet_index [nil, Integer] If given, specifies which worksheet index to parse (first is 0). If nil, expects exactly one worksheet.
44
+ # @return [Array<Array>] a list of rows
45
+ def self.parse(data, header_converters: nil, worksheet_index: nil)
20
46
  fake_file = StringIO.new(data)
21
47
  book = Spreadsheet.open(fake_file)
22
48
 
23
- # We could support multiple worksheets, but let's not until we actually need it.
24
- # Until then, we prefer raising to silently ignoring worksheets.
25
- worksheet_count = book.worksheets.length
26
- raise "Expected 1 worksheet, found #{worksheet_count}." if worksheet_count > 1
27
-
28
- book.worksheet(0).to_a.map(&:to_a).map { |row|
29
- row.map { |cell|
30
- case cell
31
- when Spreadsheet::Formula then cell.value
32
- when Spreadsheet::Link then cell.href
33
- else cell
49
+ # We prefer raising to silently ignoring worksheets.
50
+ if !worksheet_index && book.worksheets.length > 1
51
+ raise "Expected 1 worksheet, found #{book.worksheets.length}."
52
+ end
53
+
54
+ worksheet_index ||= 0
55
+
56
+ is_first_row = true
57
+ book.worksheet(worksheet_index).to_a.map(&:to_a).map { |row|
58
+ row.each_with_index.map { |cell, index|
59
+ value =
60
+ case cell
61
+ when Spreadsheet::Formula then cell.value
62
+ when Spreadsheet::Link then cell.href
63
+ else cell
64
+ end
65
+
66
+ if header_converters && is_first_row
67
+ case header_converters
68
+ when Proc then
69
+ value = header_converters.call(value)
70
+ when Symbol then
71
+ value = HEADER_CONVERTERS[header_converters].call(value)
72
+ when Enumerable then
73
+ # Apply the converters in order.
74
+ header_converters.each { |name|
75
+ value = HEADER_CONVERTERS.fetch(name).call(value)
76
+ }
77
+ else
78
+ raise "Unsupported kind of header_converters #{header_converters.inspect}"
79
+ end
80
+ value
81
+ else
82
+ value
34
83
  end
84
+ }.tap {
85
+ is_first_row = false
35
86
  }
36
87
  }
37
88
  end
38
89
 
39
- def self.parse_file(path)
40
- parse File.read(path)
90
+ def self.parse_file(path, header_converters: nil)
91
+ parse(File.read(path), header_converters: header_converters)
41
92
  end
42
93
  end
data/spec/esv_spec.rb CHANGED
@@ -1,130 +1,224 @@
1
1
  require "esv"
2
2
 
3
- describe ESV, ".generate and .parse" do
4
- it "works" do
5
- data = ESV.generate do |esv|
6
- esv << [ "Dogs", "Cats" ]
7
- esv << [ 1, 2 ]
3
+ RSpec.describe ESV do
4
+ describe ".generate and .parse" do
5
+ it "works" do
6
+ data = ESV.generate do |esv|
7
+ esv << [ "Dogs", "Cats" ]
8
+ esv << [ 1, 2 ]
9
+ end
10
+
11
+ output = ESV.parse(data)
12
+
13
+ expect(output).to eq [
14
+ [ "Dogs", "Cats" ],
15
+ [ 1, 2 ],
16
+ ]
8
17
  end
9
-
10
- output = ESV.parse(data)
11
-
12
- expect(output).to eq [
13
- [ "Dogs", "Cats" ],
14
- [ 1, 2 ],
15
- ]
16
18
  end
17
- end
18
19
 
19
- describe ESV, ".parse" do
20
- it "raises if there's more than one worksheet" do
21
- expect {
22
- ESV.parse(excel_file_with_two_worksheets)
23
- }.to raise_error(/Expected 1 worksheet, found 2/)
24
- end
20
+ describe "::HEADER_CONVERTERS" do
21
+ context "with :downcase" do
22
+ it "downcases string value" do
23
+ expect(described_class::HEADER_CONVERTERS[:downcase].call("CAT")).to eq("cat")
24
+ end
25
25
 
26
- it "ignores formatting, always returning a plain array of data" do
27
- output = ESV.parse(excel_file_with_formatting([1, 2]))
28
- expect(output).to eq [
29
- [ 1, 2 ],
30
- ]
26
+ it "returns a non-string value" do
27
+ expect(described_class::HEADER_CONVERTERS[:downcase].call(1)).to eq(1)
28
+ end
29
+ end
31
30
 
32
- expect(output[0].class).to eq Array
33
- end
31
+ context "with :symbol" do
32
+ it "stringifies before symbolizing given value" do
33
+ expect(described_class::HEADER_CONVERTERS[:symbol].call(1)).to eq(:"1")
34
+ end
34
35
 
35
- it "returns the last value of a formula cell" do
36
- output = ESV.parse(excel_file_with_formula)
37
- expect(output).to eq [
38
- [ "one", "two" ],
39
- ]
36
+ it "symbolizes given value" do
37
+ expect(described_class::HEADER_CONVERTERS[:symbol].call("cat")).to eq(:cat)
38
+ end
40
39
 
41
- expect(output[0].class).to eq Array
42
- end
40
+ context "symbolizes and" do
41
+ it "downcases given value" do
42
+ expect(described_class::HEADER_CONVERTERS[:symbol].call("CAT")).to eq(:cat)
43
+ end
44
+
45
+ it "strips any spaces around value" do
46
+ expect(described_class::HEADER_CONVERTERS[:symbol].call(" CAT ")).to eq(:cat)
47
+ end
43
48
 
44
- it "returns the last value of a formula cell" do
45
- output = ESV.parse(excel_file_with_formula)
46
- expect(output).to eq [
47
- [ "one", "two" ],
48
- ]
49
+ it "replaces embedded spaces with underscores" do
50
+ expect(described_class::HEADER_CONVERTERS[:symbol].call("CAT CAT")).to eq(:cat_cat)
51
+ end
49
52
 
50
- expect(output[0].class).to eq Array
53
+ it "removes non-word characters" do
54
+ expect(described_class::HEADER_CONVERTERS[:symbol].call("CAT?")).to eq(:cat)
55
+ end
56
+ end
57
+ end
51
58
  end
52
59
 
53
- it "returns the URL of a link cell" do
54
- output = ESV.parse(excel_file_with_link("https://example.com"))
55
- expect(output).to eq [
56
- [ "one", "https://example.com" ],
57
- ]
60
+ describe ".parse" do
61
+ describe "worksheet handling" do
62
+ context "with more than one worksheet" do
63
+ let(:excel_file_with_two_worksheets) {
64
+ generate_excel_file do |sheet_0, book|
65
+ sheet_0.row(0).replace([ "I am worksheet 0" ])
66
+
67
+ sheet_1 = book.create_worksheet
68
+ sheet_1.row(0).replace([ "I am worksheet 1" ])
69
+ end
70
+ }
71
+
72
+ it "raises when not given a worksheet index" do
73
+ expect {
74
+ ESV.parse(excel_file_with_two_worksheets)
75
+ }.to raise_error(/Expected 1 worksheet, found 2/)
76
+ end
77
+
78
+ it "allows specifying a worksheet index" do
79
+ output = ESV.parse(excel_file_with_two_worksheets, worksheet_index: 0)
80
+ expect(output).to eq [[ "I am worksheet 0" ]]
81
+
82
+ output = ESV.parse(excel_file_with_two_worksheets, worksheet_index: 1)
83
+ expect(output).to eq [[ "I am worksheet 1" ]]
84
+ end
85
+ end
86
+ end
87
+
88
+ it "ignores formatting, always returning a plain array of data" do
89
+ excel_file_with_formatting = generate_excel_file do |sheet|
90
+ sheet.row(0).replace([ 1, 2 ])
91
+ sheet.row(0).default_format = Spreadsheet::Format.new(color: :blue)
92
+ end
58
93
 
59
- expect(output[0][1].class).to eq String
60
- end
94
+ output = ESV.parse(excel_file_with_formatting)
61
95
 
62
- private
96
+ expect(output).to eq [
97
+ [ 1, 2 ],
98
+ ]
63
99
 
64
- def excel_file_with_two_worksheets
65
- excel_file do |sheet, book|
66
- book.create_worksheet
100
+ expect(output[0].class).to eq Array
67
101
  end
68
- end
69
102
 
70
- def excel_file_with_formatting(data)
71
- excel_file do |sheet|
72
- sheet.row(0).replace(data)
73
- sheet.row(0).default_format = Spreadsheet::Format.new(color: :blue)
103
+ it "returns the last value of a formula cell" do
104
+ excel_file_with_formula = generate_excel_file do |sheet|
105
+ formula = Spreadsheet::Formula.new
106
+ formula.value = "two"
107
+ sheet.row(0).replace([ "one", formula ])
108
+ end
109
+
110
+ output = ESV.parse(excel_file_with_formula)
111
+
112
+ expect(output).to eq [
113
+ [ "one", "two" ],
114
+ ]
115
+ expect(output[0].class).to eq Array
74
116
  end
75
- end
76
117
 
77
- def excel_file_with_formula
78
- excel_file do |sheet|
79
- formula = Spreadsheet::Formula.new
80
- formula.value = "two"
81
- sheet.row(0).replace([ "one", formula ])
118
+
119
+ it "returns the URL of a link cell" do
120
+ excel_file_with_link = generate_excel_file do |sheet|
121
+ link = Spreadsheet::Link.new("https://example.com", "desc", "foo")
122
+ sheet.row(0).replace([ "one", link ])
123
+ end
124
+ output = ESV.parse(excel_file_with_link)
125
+ expect(output).to eq [
126
+ [ "one", "https://example.com#foo" ],
127
+ ]
128
+
129
+ expect(output[0][1].class).to eq String
82
130
  end
83
- end
84
131
 
85
- def excel_file_with_link(url)
86
- excel_file do |sheet|
87
- link = Spreadsheet::Link.new(url)
88
- sheet.row(0).replace([ "one", link ])
132
+ context "when given a header_converters: option" do
133
+ let(:data) {
134
+ ESV.generate do |esv|
135
+ esv << [ "Dogs", "Cats cats" ]
136
+ esv << [ 1, 2 ]
137
+ end
138
+ }
139
+
140
+ it "lets you specify header_converters by symbolic name" do
141
+ output = ESV.parse(data, header_converters: :downcase)
142
+
143
+ expect(output).to eq [
144
+ [ "dogs", "cats cats" ],
145
+ [ 1, 2 ],
146
+ ]
147
+ end
148
+
149
+ it "lets you specify header_converters as a proc" do
150
+ output = ESV.parse(data, header_converters: ->(value) { value.upcase })
151
+
152
+ expect(output).to eq [
153
+ [ "DOGS", "CATS CATS" ],
154
+ [ 1, 2 ],
155
+ ]
156
+ end
157
+
158
+ it "lets you register new symbolic names for header_converters and use them" do
159
+ ESV::HEADER_CONVERTERS[:upcase] = ->(value) { value.upcase }
160
+
161
+ output = ESV.parse(data, header_converters: :upcase)
162
+
163
+ expect(output).to eq [
164
+ [ "DOGS", "CATS CATS" ],
165
+ [ 1, 2 ],
166
+ ]
167
+
168
+ ESV::HEADER_CONVERTERS.delete(:upcase)
169
+ end
170
+
171
+ it "lets you specify header_converters by symbolic names as a list and have them apply in order" do
172
+ ESV::HEADER_CONVERTERS[:reverse] = ->(value) { value.reverse }
173
+ output = ESV.parse(data, header_converters: [ :downcase, :reverse, :symbol ])
174
+
175
+ expect(output).to eq [
176
+ [ :sgod, :stac_stac ],
177
+ [ 1, 2 ],
178
+ ]
179
+ ESV::HEADER_CONVERTERS.delete(:reverse)
180
+ end
89
181
  end
90
- end
91
182
 
92
- def excel_file(&block)
93
- book = Spreadsheet::Workbook.new
94
- sheet = book.create_worksheet
183
+ private
95
184
 
96
- block.call(sheet, book)
185
+ def generate_excel_file(&block)
186
+ book = Spreadsheet::Workbook.new
187
+ sheet = book.create_worksheet
97
188
 
98
- data = ""
99
- fake_file = StringIO.new(data)
100
- book.write(fake_file)
101
- data
102
- end
103
- end
189
+ block.call(sheet, book)
104
190
 
105
- describe ESV, ".generate_file and .parse_file" do
106
- before do
107
- @file = Tempfile.new("esv")
191
+ data = ""
192
+ fake_file = StringIO.new(data)
193
+ book.write(fake_file)
194
+ data
195
+ end
108
196
  end
109
197
 
110
- it "works" do
111
- path = @file.path
112
-
113
- ESV.generate_file(path) do |esv|
114
- esv << [ "Dogs", "Cats" ]
115
- esv << [ 1, 2 ]
198
+ describe ".generate_file and .parse_file" do
199
+ before do
200
+ @file = Tempfile.new("esv")
116
201
  end
117
202
 
118
- output = ESV.parse_file(path)
203
+ it "works" do
204
+ path = @file.path
119
205
 
120
- expect(output).to eq [
121
- [ "Dogs", "Cats" ],
122
- [ 1, 2 ],
123
- ]
124
- end
206
+ ESV.generate_file(path) do |esv|
207
+ esv << [ "Dogs", "Cats" ]
208
+ esv << [ 1, 2 ]
209
+ end
210
+
211
+ output = ESV.parse_file(path)
125
212
 
126
- after do
127
- @file.close
128
- @file.unlink
213
+ expect(output).to eq [
214
+ [ "Dogs", "Cats" ],
215
+ [ 1, 2 ],
216
+ ]
217
+ end
218
+
219
+ after do
220
+ @file.close
221
+ @file.unlink
222
+ end
129
223
  end
130
224
  end
data/spec/spec_helper.rb CHANGED
@@ -1,23 +1,4 @@
1
- # This file was generated by the `rspec --init` command. Conventionally, all
2
- # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3
- # The generated `.rspec` file contains `--require spec_helper` which will cause this
4
- # file to always be loaded, without a need to explicitly require it in any files.
5
- #
6
- # Given that it is always loaded, you are encouraged to keep this file as
7
- # light-weight as possible. Requiring heavyweight dependencies from this file
8
- # will add to the boot time of your test suite on EVERY test run, even for an
9
- # individual file that may not need all of that loaded. Instead, make a
10
- # separate helper file that requires this one and then use it only in the specs
11
- # that actually need it.
12
- #
13
- # The `.rspec` file also contains a few flags that are not defaults but that
14
- # users commonly want.
15
- #
16
- # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
17
1
  RSpec.configure do |config|
18
- # The settings below are suggested to provide a good initial experience
19
- # with RSpec, but feel free to customize to your heart's content.
20
- =begin
21
2
  # These two settings work together to allow you to limit a spec run
22
3
  # to individual examples or groups you care about by tagging them with
23
4
  # `:focus` metadata. When nothing is tagged with `:focus`, all examples
@@ -32,7 +13,7 @@ RSpec.configure do |config|
32
13
  # Use the documentation formatter for detailed output,
33
14
  # unless a formatter has already been configured
34
15
  # (e.g. via a command-line flag).
35
- config.default_formatter = 'doc'
16
+ config.default_formatter = "doc"
36
17
  end
37
18
 
38
19
  # Print the 10 slowest examples and example groups at the
@@ -45,6 +26,7 @@ RSpec.configure do |config|
45
26
  # the seed, which is printed after each run.
46
27
  # --seed 1234
47
28
  config.order = :random
29
+ config.disable_monkey_patching!
48
30
 
49
31
  # Seed global randomization in this process using the `--seed` CLI option.
50
32
  # Setting this allows you to use `--seed` to deterministically reproduce
@@ -62,17 +44,11 @@ RSpec.configure do |config|
62
44
  expectations.syntax = :expect
63
45
  end
64
46
 
65
- # rspec-mocks config goes here. You can use an alternate test double
66
- # library (such as bogus or mocha) by changing the `mock_with` option here.
67
47
  config.mock_with :rspec do |mocks|
68
- # Enable only the newer, non-monkey-patching expect syntax.
69
- # For more details, see:
70
- # - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
71
48
  mocks.syntax = :expect
72
49
 
73
50
  # Prevents you from mocking or stubbing a method that does not exist on
74
51
  # a real object. This is generally recommended.
75
52
  mocks.verify_partial_doubles = true
76
53
  end
77
- =end
78
54
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: excel-esv
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henrik Nyh
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2018-11-20 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: spreadsheet
@@ -25,56 +24,30 @@ dependencies:
25
24
  - !ruby/object:Gem::Version
26
25
  version: '0'
27
26
  - !ruby/object:Gem::Dependency
28
- name: bundler
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '1.7'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '1.7'
41
- - !ruby/object:Gem::Dependency
42
- name: rake
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '10.0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '10.0'
55
- - !ruby/object:Gem::Dependency
56
- name: rspec
27
+ name: logger
57
28
  requirement: !ruby/object:Gem::Requirement
58
29
  requirements:
59
30
  - - ">="
60
31
  - !ruby/object:Gem::Version
61
32
  version: '0'
62
- type: :development
33
+ type: :runtime
63
34
  prerelease: false
64
35
  version_requirements: !ruby/object:Gem::Requirement
65
36
  requirements:
66
37
  - - ">="
67
38
  - !ruby/object:Gem::Version
68
39
  version: '0'
69
- description:
70
40
  email:
71
41
  - henrik@nyh.se
72
42
  executables: []
73
43
  extensions: []
74
44
  extra_rdoc_files: []
75
45
  files:
46
+ - ".github/dependabot.yml"
47
+ - ".github/workflows/ci.yml"
76
48
  - ".gitignore"
77
49
  - ".rspec"
50
+ - ".rubocop.yml"
78
51
  - CHANGELOG.md
79
52
  - Gemfile
80
53
  - LICENSE.txt
@@ -91,8 +64,8 @@ files:
91
64
  homepage: https://github.com/barsoom/excel-esv
92
65
  licenses:
93
66
  - MIT
94
- metadata: {}
95
- post_install_message:
67
+ metadata:
68
+ rubygems_mfa_required: 'true'
96
69
  rdoc_options: []
97
70
  require_paths:
98
71
  - lib
@@ -107,11 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
80
  - !ruby/object:Gem::Version
108
81
  version: '0'
109
82
  requirements: []
110
- rubyforge_project:
111
- rubygems_version: 2.6.11
112
- signing_key:
83
+ rubygems_version: 3.6.9
113
84
  specification_version: 4
114
85
  summary: Excel parsing and generation with the ease of CSV.
115
- test_files:
116
- - spec/esv_spec.rb
117
- - spec/spec_helper.rb
86
+ test_files: []