roo 2.10.1 → 3.0.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 +4 -4
- data/.github/pull_request_template.md +19 -1
- data/.github/workflows/release-please.yml +52 -0
- data/.github/workflows/ruby.yml +11 -5
- data/.gitignore +2 -1
- data/.release-please-manifest.json +3 -0
- data/.rubocop.yml +8 -11
- data/CHANGELOG.md +28 -6
- data/Gemfile +5 -2
- data/README.md +19 -2
- data/checksums/roo-2.10.1.gem.sha512 +1 -0
- data/lib/roo/excelx/comments.rb +1 -1
- data/lib/roo/excelx.rb +6 -6
- data/lib/roo/formatters/csv.rb +9 -1
- data/lib/roo/formatters/yaml.rb +1 -1
- data/lib/roo/open_office.rb +2 -2
- data/lib/roo/spreadsheet.rb +1 -1
- data/lib/roo/utils.rb +1 -2
- data/lib/roo/version.rb +1 -1
- data/release-please-config.json +12 -0
- data/roo.gemspec +12 -9
- data/spec/lib/roo/base_spec.rb +15 -1
- data/spec/spec_helper.rb +11 -0
- data/test/helpers/test_comments.rb +11 -0
- data/test/roo/test_open_office.rb +1 -1
- data/test/test_helper.rb +2 -2
- data/test/test_roo.rb +0 -2
- metadata +76 -20
- data/.codeclimate.yml +0 -17
- data/.github/workflows/pull-request.yml +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e760df54834eed96fbedb5e0aeffa97108962130bd861568ed1d68340487001f
|
4
|
+
data.tar.gz: af4b682bef65d6cc7b843aa99123fe0bc28bac335ebd5af64029584e843000dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cdf6d407e8e10090720f46a60ded37a6c1ad1aa9d3e764547917fe3bb71d4fcd89b9f97d6cffd581472ce2e7df2f581c26c4d75366e342ec848a45e1fc6bd3d8
|
7
|
+
data.tar.gz: d91a0596f2cafd202af7e75faf2adabc8e9b3e44ff8067f0d7feacceb1f2a66d8d3d1b0e34713b489ae618c73023de472647f65f861c7c0d997ead504bdd359d
|
@@ -1,3 +1,21 @@
|
|
1
|
+
<!--
|
2
|
+
Thank you for your contribution!
|
3
|
+
|
4
|
+
Please ensure your pull request title follows the Conventional Commits format.
|
5
|
+
This is important because our release process is automated based on the commit messages.
|
6
|
+
|
7
|
+
Examples:
|
8
|
+
- feat: Add new feature
|
9
|
+
- fix: Fix a bug
|
10
|
+
- docs: Update documentation
|
11
|
+
- chore: Build process or auxiliary tool changes
|
12
|
+
- refactor: A code change that neither fixes a bug nor adds a feature
|
13
|
+
- style: Changes that do not affect the meaning of the code (white-space, formatting, etc)
|
14
|
+
- test: Adding missing tests or correcting existing tests
|
15
|
+
|
16
|
+
If your change is a breaking change, please add a '!' after the type, e.g., 'feat!: ...'
|
17
|
+
-->
|
18
|
+
|
1
19
|
### Summary
|
2
20
|
|
3
21
|
Provide a general description of the code changes in your pull
|
@@ -11,4 +29,4 @@ If there's anything else that's important and relevant to your pull
|
|
11
29
|
request, mention that information here. This could include
|
12
30
|
benchmarks, or other information.
|
13
31
|
|
14
|
-
Thanks for contributing to Roo!
|
32
|
+
Thanks for contributing to Roo!
|
@@ -0,0 +1,52 @@
|
|
1
|
+
name: Release Please
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- master
|
7
|
+
|
8
|
+
concurrency:
|
9
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
10
|
+
cancel-in-progress: true
|
11
|
+
|
12
|
+
jobs:
|
13
|
+
release-please:
|
14
|
+
runs-on: ubuntu-latest
|
15
|
+
outputs:
|
16
|
+
release_created: ${{ steps.release.outputs.release_created }}
|
17
|
+
tag_name: ${{ steps.release.outputs.tag_name }}
|
18
|
+
steps:
|
19
|
+
- uses: googleapis/release-please-action@v4
|
20
|
+
id: release
|
21
|
+
with:
|
22
|
+
config-file: release-please-config.json
|
23
|
+
manifest-file: .release-please-manifest.json
|
24
|
+
|
25
|
+
publish:
|
26
|
+
needs: release-please
|
27
|
+
if: ${{ needs.release-please.outputs.release_created }}
|
28
|
+
runs-on: ubuntu-latest
|
29
|
+
environment: PUBLISH
|
30
|
+
permissions:
|
31
|
+
contents: write
|
32
|
+
id-token: write
|
33
|
+
steps:
|
34
|
+
- name: Checkout repository
|
35
|
+
uses: actions/checkout@v4
|
36
|
+
with:
|
37
|
+
ref: ${{ needs.release-please.outputs.tag_name }}
|
38
|
+
fetch-tags: true
|
39
|
+
|
40
|
+
- name: Set up Ruby
|
41
|
+
uses: ruby/setup-ruby@v1
|
42
|
+
with:
|
43
|
+
ruby-version: '3.4'
|
44
|
+
bundler-cache: true
|
45
|
+
|
46
|
+
- name: Publish to RubyGems
|
47
|
+
uses: rubygems/release-gem@v1
|
48
|
+
|
49
|
+
- name: Upload Gem to GitHub Release
|
50
|
+
env:
|
51
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
52
|
+
run: gh release upload ${{ needs.release-please.outputs.tag_name }} ./*.gem --clobber
|
data/.github/workflows/ruby.yml
CHANGED
@@ -6,6 +6,11 @@ on:
|
|
6
6
|
pull_request:
|
7
7
|
branches:
|
8
8
|
- master
|
9
|
+
|
10
|
+
concurrency:
|
11
|
+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
12
|
+
cancel-in-progress: true
|
13
|
+
|
9
14
|
jobs:
|
10
15
|
build:
|
11
16
|
runs-on: ubuntu-latest
|
@@ -13,17 +18,19 @@ jobs:
|
|
13
18
|
fail-fast: false
|
14
19
|
matrix:
|
15
20
|
ruby:
|
16
|
-
- '2.7'
|
17
|
-
- '3.0'
|
18
21
|
- '3.1'
|
22
|
+
- '3.2'
|
23
|
+
- '3.3'
|
24
|
+
- '3.4'
|
25
|
+
- '3.5'
|
19
26
|
- ruby-head
|
20
|
-
- jruby-9.
|
27
|
+
- jruby-9.4.10.0
|
21
28
|
include:
|
22
29
|
- ruby: ruby-head
|
23
30
|
env:
|
24
31
|
RUBYOPT: '--jit'
|
25
32
|
steps:
|
26
|
-
- uses: actions/checkout@
|
33
|
+
- uses: actions/checkout@v4
|
27
34
|
- uses: ruby/setup-ruby@v1
|
28
35
|
with:
|
29
36
|
ruby-version: ${{ matrix.ruby }}
|
@@ -31,4 +38,3 @@ jobs:
|
|
31
38
|
- run: bundle exec rake
|
32
39
|
env:
|
33
40
|
LONG_RUN: true
|
34
|
-
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
@@ -1,8 +1,11 @@
|
|
1
|
+
require: rubocop-performance
|
2
|
+
|
1
3
|
AllCops:
|
2
|
-
TargetRubyVersion:
|
4
|
+
TargetRubyVersion: 3.1
|
3
5
|
# RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
|
4
6
|
# to ignore them, so only the ones explicitly set in this file are enabled.
|
5
7
|
DisabledByDefault: true
|
8
|
+
SuggestExtensions: false
|
6
9
|
|
7
10
|
Performance:
|
8
11
|
Exclude:
|
@@ -13,12 +16,6 @@ Performance:
|
|
13
16
|
Style/AndOr:
|
14
17
|
Enabled: true
|
15
18
|
|
16
|
-
# Do not use braces for hash literals when they are the last argument of a
|
17
|
-
# method call.
|
18
|
-
Style/BracesAroundHashParameters:
|
19
|
-
Enabled: true
|
20
|
-
EnforcedStyle: context_dependent
|
21
|
-
|
22
19
|
# Align `when` with `case`.
|
23
20
|
Layout/CaseIndentation:
|
24
21
|
Enabled: true
|
@@ -127,11 +124,11 @@ Style/StringLiterals:
|
|
127
124
|
EnforcedStyle: double_quotes
|
128
125
|
|
129
126
|
# Detect hard tabs, no hard tabs.
|
130
|
-
Layout/
|
127
|
+
Layout/IndentationStyle:
|
131
128
|
Enabled: true
|
132
129
|
|
133
130
|
# Blank lines should not have any spaces.
|
134
|
-
Layout/
|
131
|
+
Layout/TrailingEmptyLines:
|
135
132
|
Enabled: true
|
136
133
|
|
137
134
|
# No trailing whitespace.
|
@@ -139,14 +136,14 @@ Layout/TrailingWhitespace:
|
|
139
136
|
Enabled: true
|
140
137
|
|
141
138
|
# Use quotes for string literals when they are enough.
|
142
|
-
Style/
|
139
|
+
Style/RedundantPercentQ:
|
143
140
|
Enabled: true
|
144
141
|
|
145
142
|
# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
|
146
143
|
Lint/RequireParentheses:
|
147
144
|
Enabled: true
|
148
145
|
|
149
|
-
Lint/
|
146
|
+
Lint/RedundantStringCoercion:
|
150
147
|
Enabled: true
|
151
148
|
|
152
149
|
Lint/UriEscapeUnescape:
|
data/CHANGELOG.md
CHANGED
@@ -1,17 +1,39 @@
|
|
1
|
+
## Unreleased
|
2
|
+
|
3
|
+
## [3.0.0](https://github.com/roo-rb/roo/compare/v2.10.1...v3.0.0) (2025-10-01)
|
4
|
+
|
5
|
+
### Miscellaneous Chores
|
6
|
+
|
7
|
+
* release 3.0.0 ([82619d3](https://github.com/roo-rb/roo/commit/82619d33929fd51411d173fbedd8a9c8136b4f72))
|
8
|
+
|
9
|
+
### Changed/Added
|
10
|
+
|
11
|
+
- Add dependencies for `csv` and `base64` if Ruby version higher or equal 3.4 [616](https://github.com/roo-rb/roo/pull/616)
|
12
|
+
- Add dependency for `logger` if Ruby version higher or equal 3.4 [618](https://github.com/roo-rb/roo/pull/618)
|
13
|
+
- Add changelog link to gemspec [605](https://github.com/roo-rb/roo/pull/605)
|
14
|
+
- Upgraded rack via usage of rackup
|
15
|
+
- Resolve deprecation warnings about uri DEFAULT_PARSER
|
16
|
+
- Add support for rubyzip 3.x [629](https://github.com/roo-rb/roo/pull/629)
|
17
|
+
|
18
|
+
### Removed
|
19
|
+
|
20
|
+
- Support for ruby 2.7, 3.0
|
21
|
+
- Support for rubyzip < 3.x
|
22
|
+
|
1
23
|
## [2.10.1] 2024-01-17
|
2
24
|
|
3
25
|
### Changed/Added
|
4
26
|
- Prevent warnings on Ruby 3.1 if finalizer is called twice [586](https://github.com/roo-rb/roo/pull/586)
|
5
27
|
- Fix Roo::Base#each_with_pagename degraded at [576](https://github.com/roo-rb/roo/pull/576) [583](https://github.com/roo-rb/roo/pull/583)
|
6
28
|
|
7
|
-
##
|
29
|
+
## [2.10.0] 2023-02-07
|
8
30
|
|
9
31
|
### Changed/Added
|
10
32
|
- Fix gsub! usage for open office documents on a frozen string [581](https://github.com/roo-rb/roo/pull/581)
|
11
33
|
- Add support for boolean values in open office files that were generated via Google Sheets [580](https://github.com/roo-rb/roo/pull/580)
|
12
34
|
- Roo::Base#each_with_pagename returns Enumerator Object [576](https://github.com/roo-rb/roo/pull/576)
|
13
35
|
|
14
|
-
##
|
36
|
+
## [2.9.0] 2022-03-19
|
15
37
|
|
16
38
|
### Changed/Added
|
17
39
|
- Ruby 3.x Support [555](https://github.com/roo-rb/roo/pull/555)
|
@@ -25,11 +47,11 @@
|
|
25
47
|
### Removed
|
26
48
|
- Support for ruby 2.4, 2.5, 2.6(excluded jRuby)
|
27
49
|
|
28
|
-
##
|
50
|
+
## [2.8.3] 2020-02-03
|
29
51
|
### Changed/Added
|
30
52
|
- Updated rubyzip version. Now minimal version is 1.3.0 [515](https://github.com/roo-rb/roo/pull/515) - [CVE-2019-16892](https://github.com/rubyzip/rubyzip/pull/403)
|
31
53
|
|
32
|
-
##
|
54
|
+
## [2.8.2] 2019-02-01
|
33
55
|
### Changed/Added
|
34
56
|
- Support range cell for Excelx's links [490](https://github.com/roo-rb/roo/pull/490)
|
35
57
|
- Skip `extract_hyperlinks` if not required [488](https://github.com/roo-rb/roo/pull/488)
|
@@ -37,11 +59,11 @@
|
|
37
59
|
### Fixed
|
38
60
|
- Fixed error for invalid link [492](https://github.com/roo-rb/roo/pull/492)
|
39
61
|
|
40
|
-
##
|
62
|
+
## [2.8.1] 2019-01-21
|
41
63
|
### Fixed
|
42
64
|
- Fixed error if excelx's cell have empty children [487](https://github.com/roo-rb/roo/pull/487)
|
43
65
|
|
44
|
-
##
|
66
|
+
## [2.8.0] 2019-01-18
|
45
67
|
### Fixed
|
46
68
|
- Fixed inconsistent column length for CSV [375](https://github.com/roo-rb/roo/pull/375)
|
47
69
|
- Fixed formatted_value with `%` for Excelx [416](https://github.com/roo-rb/roo/pull/416)
|
data/Gemfile
CHANGED
@@ -2,15 +2,18 @@ source 'https://rubygems.org'
|
|
2
2
|
|
3
3
|
gemspec
|
4
4
|
|
5
|
+
gem 'rubocop'
|
6
|
+
gem 'rubocop-performance', require: false
|
7
|
+
|
5
8
|
group :test do
|
6
9
|
# additional testing libs
|
7
10
|
gem 'shoulda'
|
8
|
-
gem 'activesupport'
|
11
|
+
gem 'activesupport'
|
9
12
|
gem 'rspec', '>= 3.0.0'
|
10
13
|
gem 'simplecov', '>= 0.9.0', require: false
|
11
14
|
gem 'coveralls', require: false
|
12
15
|
gem "minitest-reporters"
|
13
|
-
gem 'webrick'
|
16
|
+
gem 'webrick'
|
14
17
|
end
|
15
18
|
|
16
19
|
group :local_development do
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Roo
|
2
2
|
|
3
|
-
[](https://travis-ci.org/roo-rb/roo) [](https://codeclimate.com/github/roo-rb/roo/maintainability) [](https://coveralls.io/r/roo-rb/roo) [](https://rubygems.org/gems/roo)
|
4
4
|
|
5
5
|
Roo implements read access for all common spreadsheet types. It can handle:
|
6
6
|
* Excel 2007 - 2013 formats (xlsx, xlsm)
|
@@ -9,6 +9,11 @@ Roo implements read access for all common spreadsheet types. It can handle:
|
|
9
9
|
* Excel 97, Excel 2002 XML, and Excel 2003 XML formats when using the [roo-xls](https://github.com/roo-rb/roo-xls) gem (xls, xml)
|
10
10
|
* Google spreadsheets with read/write access when using [roo-google](https://github.com/roo-rb/roo-google)
|
11
11
|
|
12
|
+
## Important note about next major release
|
13
|
+
|
14
|
+
There a plan to make a new major release which will have better support for Ruby 3.x
|
15
|
+
Please leave your comments there - https://github.com/roo-rb/roo/issues/630
|
16
|
+
|
12
17
|
## Installation
|
13
18
|
|
14
19
|
Install as a gem
|
@@ -18,7 +23,7 @@ Install as a gem
|
|
18
23
|
Or add it to your Gemfile
|
19
24
|
|
20
25
|
```ruby
|
21
|
-
gem "roo", "~>
|
26
|
+
gem "roo", "~> 3.0.0"
|
22
27
|
```
|
23
28
|
## Usage
|
24
29
|
|
@@ -171,6 +176,18 @@ sheet.to_xml
|
|
171
176
|
sheet.to_yaml
|
172
177
|
```
|
173
178
|
|
179
|
+
Specify the file as default argument for `#to_csv`:
|
180
|
+
|
181
|
+
```ruby
|
182
|
+
sheet.to_csv(File.new("/dev/null"))
|
183
|
+
```
|
184
|
+
|
185
|
+
specify the custom separator:
|
186
|
+
|
187
|
+
```ruby
|
188
|
+
sheet.to_csv(separator: ":") # "," using by default
|
189
|
+
```
|
190
|
+
|
174
191
|
### Excel (xlsx and xlsm) Support
|
175
192
|
|
176
193
|
Stream rows from an Excelx spreadsheet.
|
@@ -0,0 +1 @@
|
|
1
|
+
bc12fbc27e9d8423e4a84eee9eaf1192c368f5c490e3b8ae0c6c65a5c0828e908d775ddb57100fa5a4c9c9b849511930e8324868ef5d61d916a2398ba9520382
|
data/lib/roo/excelx/comments.rb
CHANGED
@@ -13,7 +13,7 @@ module Roo
|
|
13
13
|
return {} unless doc_exists?
|
14
14
|
|
15
15
|
doc.xpath('//comments/commentList/comment').each_with_object({}) do |comment, hash|
|
16
|
-
value =
|
16
|
+
value = comment.xpath('./text/r/t', './text/t').text
|
17
17
|
hash[::Roo::Utils.ref_to_key(comment['ref'].to_s)] = value
|
18
18
|
end
|
19
19
|
end
|
data/lib/roo/excelx.rb
CHANGED
@@ -333,7 +333,7 @@ module Roo
|
|
333
333
|
wb = entries.find { |e| e.name[/workbook.xml$/] }
|
334
334
|
fail ArgumentError 'missing required workbook file' if wb.nil?
|
335
335
|
|
336
|
-
wb.extract(path)
|
336
|
+
wb.extract(File.basename(path), destination_directory: File.dirname(path))
|
337
337
|
workbook_doc = Roo::Utils.load_xml(path).remove_namespaces!
|
338
338
|
workbook_doc.xpath('//sheet').map { |s| s['id'] }
|
339
339
|
end
|
@@ -357,7 +357,7 @@ module Roo
|
|
357
357
|
wb_rels = entries.find { |e| e.name[/workbook.xml.rels$/] }
|
358
358
|
fail ArgumentError 'missing required workbook file' if wb_rels.nil?
|
359
359
|
|
360
|
-
wb_rels.extract(path)
|
360
|
+
wb_rels.extract(File.basename(path), destination_directory: File.dirname(path))
|
361
361
|
rels_doc = Roo::Utils.load_xml(path).remove_namespaces!
|
362
362
|
|
363
363
|
relationships = rels_doc.xpath('//Relationship').select do |relationship|
|
@@ -378,7 +378,7 @@ module Roo
|
|
378
378
|
path = "#{tmpdir}/roo_sheet#{i + 1}"
|
379
379
|
sheet_files << path
|
380
380
|
@sheet_files << path
|
381
|
-
entry.extract(path)
|
381
|
+
entry.extract(File.basename(path), destination_directory: File.dirname(path))
|
382
382
|
end
|
383
383
|
end
|
384
384
|
|
@@ -387,7 +387,7 @@ module Roo
|
|
387
387
|
img_entries.each do |entry|
|
388
388
|
path = "#{@tmpdir}/roo#{entry.name.gsub(/xl\/|\//, "_")}"
|
389
389
|
image_files << path
|
390
|
-
entry.extract(path)
|
390
|
+
entry.extract(File.basename(path), destination_directory: File.dirname(path))
|
391
391
|
end
|
392
392
|
end
|
393
393
|
|
@@ -402,7 +402,7 @@ module Roo
|
|
402
402
|
zip_file.read_from_stream zipfilename_or_stream
|
403
403
|
end
|
404
404
|
|
405
|
-
process_zipfile_entries zip_file.
|
405
|
+
process_zipfile_entries zip_file.entries.sort_by(&:name)
|
406
406
|
end
|
407
407
|
|
408
408
|
def process_zipfile_entries(entries)
|
@@ -462,7 +462,7 @@ module Roo
|
|
462
462
|
image_rels[nr - 1] = "#{@tmpdir}/roo_image_rels#{nr}"
|
463
463
|
end
|
464
464
|
|
465
|
-
entry.extract(path) if path
|
465
|
+
entry.extract(File.basename(path), destination_directory: File.dirname(path)) if path
|
466
466
|
end
|
467
467
|
end
|
468
468
|
|
data/lib/roo/formatters/csv.rb
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
module Roo
|
2
2
|
module Formatters
|
3
3
|
module CSV
|
4
|
-
def to_csv(filename = nil,
|
4
|
+
def to_csv(filename = nil, old_separator = nil, old_sheet = nil, separator: ",", sheet: default_sheet)
|
5
|
+
if old_separator
|
6
|
+
warn("[DEPRECATION] optional argument for separator is deprecated. Please use keyword argument :separator instead")
|
7
|
+
separator = old_separator
|
8
|
+
end
|
9
|
+
if old_sheet
|
10
|
+
warn("[DEPRECATION] optional argument for sheet is deprecated. Please use keyword argument :sheet instead")
|
11
|
+
sheet = old_sheet
|
12
|
+
end
|
5
13
|
if filename
|
6
14
|
File.open(filename, "w") do |file|
|
7
15
|
write_csv_content(file, sheet, separator)
|
data/lib/roo/formatters/yaml.rb
CHANGED
data/lib/roo/open_office.rb
CHANGED
@@ -59,7 +59,7 @@ module Roo
|
|
59
59
|
fail ArgumentError, ERROR_MISSING_CONTENT_XML unless content_entry
|
60
60
|
|
61
61
|
roo_content_xml_path = ::File.join(@tmpdir, 'roo_content.xml')
|
62
|
-
content_entry.extract(
|
62
|
+
content_entry.extract('roo_content.xml', destination_directory: @tmpdir)
|
63
63
|
decrypt_if_necessary(zip_file, content_entry, roo_content_xml_path, options)
|
64
64
|
end
|
65
65
|
end
|
@@ -234,7 +234,7 @@ module Roo
|
|
234
234
|
|
235
235
|
if (manifest_entry = zip_file.glob('META-INF/manifest.xml').first)
|
236
236
|
roo_manifest_xml_path = File.join(@tmpdir, 'roo_manifest.xml')
|
237
|
-
manifest_entry.extract(
|
237
|
+
manifest_entry.extract('roo_manifest.xml', destination_directory: @tmpdir)
|
238
238
|
manifest = ::Roo::Utils.load_xml(roo_manifest_xml_path)
|
239
239
|
|
240
240
|
# XPath search for manifest:encryption-data only for the content.xml
|
data/lib/roo/spreadsheet.rb
CHANGED
data/lib/roo/utils.rb
CHANGED
@@ -5,6 +5,7 @@ module Roo
|
|
5
5
|
extend self
|
6
6
|
|
7
7
|
LETTERS = ('A'..'Z').to_a
|
8
|
+
URI_PARSER = defined?(::URI::RFC2396_PARSER) ? ::URI::RFC2396_PARSER : ::URI::DEFAULT_PARSER
|
8
9
|
|
9
10
|
def extract_coordinate(s)
|
10
11
|
num = letter_num = 0
|
@@ -34,8 +35,6 @@ module Roo
|
|
34
35
|
extract_coordinate(str)
|
35
36
|
end
|
36
37
|
|
37
|
-
|
38
|
-
|
39
38
|
def split_coord(str)
|
40
39
|
coord = extract_coordinate(str)
|
41
40
|
[number_to_letter(coord.column), coord.row]
|
data/lib/roo/version.rb
CHANGED
@@ -0,0 +1,12 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
|
3
|
+
"packages": {
|
4
|
+
".": {
|
5
|
+
"version-file": "lib/roo/version.rb",
|
6
|
+
"release-type": "ruby",
|
7
|
+
"changelog-path": "CHANGELOG.md",
|
8
|
+
"include-component-in-tag": false,
|
9
|
+
"include-v-in-tag": true
|
10
|
+
}
|
11
|
+
}
|
12
|
+
}
|
data/roo.gemspec
CHANGED
@@ -17,19 +17,22 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.files.reject! { |fn| fn.include?('test/files') }
|
18
18
|
spec.require_paths = ['lib']
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
spec.
|
20
|
+
spec.required_ruby_version = ">= 3.1.0"
|
21
|
+
|
22
|
+
if RUBY_VERSION >= '3.4.0'
|
23
|
+
spec.add_dependency 'base64', '~> 0.2'
|
24
|
+
spec.add_dependency 'csv', '~> 3'
|
25
|
+
spec.add_dependency 'logger', '~> 1'
|
24
26
|
end
|
25
27
|
|
26
28
|
spec.add_dependency 'nokogiri', '~> 1'
|
27
|
-
spec.add_dependency 'rubyzip', '>=
|
29
|
+
spec.add_dependency 'rubyzip', '>= 3.0.0', '< 4.0.0'
|
28
30
|
|
29
31
|
spec.add_development_dependency 'rake'
|
30
32
|
spec.add_development_dependency 'minitest', '~> 5.4', '>= 5.4.3'
|
31
|
-
spec.add_development_dependency 'rack', '
|
32
|
-
|
33
|
-
|
34
|
-
|
33
|
+
spec.add_development_dependency 'rack', '>= 3.0.0'
|
34
|
+
spec.add_development_dependency 'rackup', '>= 2.2.1', '< 3.0.0'
|
35
|
+
spec.add_development_dependency 'matrix'
|
36
|
+
|
37
|
+
spec.metadata["changelog_uri"] = spec.homepage + '/blob/master/CHANGELOG.md'
|
35
38
|
end
|
data/spec/lib/roo/base_spec.rb
CHANGED
@@ -289,7 +289,21 @@ EOS
|
|
289
289
|
end
|
290
290
|
|
291
291
|
it 'should convert the spreadsheet to csv using the separator when is passed on the parameter' do
|
292
|
-
expect(spreadsheet.to_csv(
|
292
|
+
expect(spreadsheet.to_csv(separator: ';')).to eq(expected_csv_with_semicolons)
|
293
|
+
end
|
294
|
+
|
295
|
+
context 'should contains the deprecation warning message' do
|
296
|
+
it 'convert the spreadsheet to csv using the separator' do
|
297
|
+
converting =-> { spreadsheet.to_csv(nil, ';') }
|
298
|
+
expect(converting.call).to eq(expected_csv_with_semicolons)
|
299
|
+
expect(&converting).to output(/DEPRECATION.*:separator\b/).to_stderr
|
300
|
+
end
|
301
|
+
|
302
|
+
it 'be able to arguments: filename, separator, sheet' do
|
303
|
+
converting =-> { spreadsheet.to_csv(nil, ';', spreadsheet.default_sheet) }
|
304
|
+
expect(converting.call).to eq(expected_csv_with_semicolons)
|
305
|
+
expect(&converting).to output(/DEPRECATION.*:sheet\b/).to_stderr
|
306
|
+
end
|
293
307
|
end
|
294
308
|
end
|
295
309
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -6,4 +6,15 @@ RSpec.configure do |c|
|
|
6
6
|
c.include Helpers
|
7
7
|
c.color = true
|
8
8
|
c.formatter = :documentation if ENV["USE_REPORTERS"]
|
9
|
+
original_stderr = $stderr
|
10
|
+
original_stdout = $stdout
|
11
|
+
c.before(:all) do
|
12
|
+
# Redirect stderr and stdout
|
13
|
+
$stderr = File.open(File::NULL, "w")
|
14
|
+
$stdout = File.open(File::NULL, "w")
|
15
|
+
end
|
16
|
+
c.after(:all) do
|
17
|
+
$stderr = original_stderr
|
18
|
+
$stdout = original_stdout
|
19
|
+
end
|
9
20
|
end
|
@@ -40,4 +40,15 @@ module TestComments
|
|
40
40
|
assert_equal expected_comments, oo.comments(oo.sheets.first), "comments error in class #{oo.class}"
|
41
41
|
end
|
42
42
|
end
|
43
|
+
|
44
|
+
def test_excel_comment_with_author
|
45
|
+
options = { name: "comments-with-author", format: [:excelx] }
|
46
|
+
expexted_comments = [
|
47
|
+
[6, 2, "Eli Wang:\ncomment with author"]
|
48
|
+
]
|
49
|
+
|
50
|
+
with_each_spreadsheet(options) do |oo|
|
51
|
+
assert_equal expexted_comments, oo.comments(oo.sheets.first), "comments error in class #{oo.class}"
|
52
|
+
end
|
53
|
+
end
|
43
54
|
end
|
@@ -224,7 +224,7 @@ class TestRooOpenOffice < Minitest::Test
|
|
224
224
|
assert workbook.empty?("C", 1)
|
225
225
|
assert workbook.empty?("D", 1)
|
226
226
|
expected = 1
|
227
|
-
letter = "e"
|
227
|
+
letter = String.new("e")
|
228
228
|
while letter <= "u"
|
229
229
|
assert_equal expected, workbook.cell(letter, 1)
|
230
230
|
letter.succ!
|
data/test/test_helper.rb
CHANGED
@@ -80,7 +80,7 @@ def local_server(port)
|
|
80
80
|
end
|
81
81
|
|
82
82
|
def start_local_server(filename, port = nil)
|
83
|
-
require "
|
83
|
+
require "rackup"
|
84
84
|
content_type = filename.split(".").last
|
85
85
|
port ||= TEST_RACK_PORT
|
86
86
|
|
@@ -92,7 +92,7 @@ def start_local_server(filename, port = nil)
|
|
92
92
|
]
|
93
93
|
end
|
94
94
|
|
95
|
-
t = Thread.new {
|
95
|
+
t = Thread.new { Rackup::Handler::WEBrick.run web_server, Host: "0.0.0.0", Port: port , Logger: WEBrick::BasicLog.new(nil,1) }
|
96
96
|
# give the app a chance to startup
|
97
97
|
sleep(0.2)
|
98
98
|
|
data/test/test_roo.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas Preymesser
|
@@ -10,11 +10,52 @@ authors:
|
|
10
10
|
- Oleksandr Simonov
|
11
11
|
- Steven Daniels
|
12
12
|
- Anmol Chopra
|
13
|
-
autorequire:
|
14
13
|
bindir: bin
|
15
14
|
cert_chain: []
|
16
|
-
date:
|
15
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
17
16
|
dependencies:
|
17
|
+
- !ruby/object:Gem::Dependency
|
18
|
+
name: base64
|
19
|
+
requirement: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - "~>"
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: '0.2'
|
24
|
+
type: :runtime
|
25
|
+
prerelease: false
|
26
|
+
version_requirements: !ruby/object:Gem::Requirement
|
27
|
+
requirements:
|
28
|
+
- - "~>"
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: '0.2'
|
31
|
+
- !ruby/object:Gem::Dependency
|
32
|
+
name: csv
|
33
|
+
requirement: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - "~>"
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '3'
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - "~>"
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '3'
|
45
|
+
- !ruby/object:Gem::Dependency
|
46
|
+
name: logger
|
47
|
+
requirement: !ruby/object:Gem::Requirement
|
48
|
+
requirements:
|
49
|
+
- - "~>"
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
version: '1'
|
52
|
+
type: :runtime
|
53
|
+
prerelease: false
|
54
|
+
version_requirements: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - "~>"
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: '1'
|
18
59
|
- !ruby/object:Gem::Dependency
|
19
60
|
name: nokogiri
|
20
61
|
requirement: !ruby/object:Gem::Requirement
|
@@ -35,20 +76,20 @@ dependencies:
|
|
35
76
|
requirements:
|
36
77
|
- - ">="
|
37
78
|
- !ruby/object:Gem::Version
|
38
|
-
version:
|
79
|
+
version: 3.0.0
|
39
80
|
- - "<"
|
40
81
|
- !ruby/object:Gem::Version
|
41
|
-
version:
|
82
|
+
version: 4.0.0
|
42
83
|
type: :runtime
|
43
84
|
prerelease: false
|
44
85
|
version_requirements: !ruby/object:Gem::Requirement
|
45
86
|
requirements:
|
46
87
|
- - ">="
|
47
88
|
- !ruby/object:Gem::Version
|
48
|
-
version:
|
89
|
+
version: 3.0.0
|
49
90
|
- - "<"
|
50
91
|
- !ruby/object:Gem::Version
|
51
|
-
version:
|
92
|
+
version: 4.0.0
|
52
93
|
- !ruby/object:Gem::Dependency
|
53
94
|
name: rake
|
54
95
|
requirement: !ruby/object:Gem::Requirement
|
@@ -87,22 +128,36 @@ dependencies:
|
|
87
128
|
name: rack
|
88
129
|
requirement: !ruby/object:Gem::Requirement
|
89
130
|
requirements:
|
90
|
-
- - "
|
131
|
+
- - ">="
|
91
132
|
- !ruby/object:Gem::Version
|
92
|
-
version:
|
133
|
+
version: 3.0.0
|
134
|
+
type: :development
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
requirements:
|
138
|
+
- - ">="
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
version: 3.0.0
|
141
|
+
- !ruby/object:Gem::Dependency
|
142
|
+
name: rackup
|
143
|
+
requirement: !ruby/object:Gem::Requirement
|
144
|
+
requirements:
|
145
|
+
- - ">="
|
146
|
+
- !ruby/object:Gem::Version
|
147
|
+
version: 2.2.1
|
93
148
|
- - "<"
|
94
149
|
- !ruby/object:Gem::Version
|
95
|
-
version:
|
150
|
+
version: 3.0.0
|
96
151
|
type: :development
|
97
152
|
prerelease: false
|
98
153
|
version_requirements: !ruby/object:Gem::Requirement
|
99
154
|
requirements:
|
100
|
-
- - "
|
155
|
+
- - ">="
|
101
156
|
- !ruby/object:Gem::Version
|
102
|
-
version:
|
157
|
+
version: 2.2.1
|
103
158
|
- - "<"
|
104
159
|
- !ruby/object:Gem::Version
|
105
|
-
version:
|
160
|
+
version: 3.0.0
|
106
161
|
- !ruby/object:Gem::Dependency
|
107
162
|
name: matrix
|
108
163
|
requirement: !ruby/object:Gem::Requirement
|
@@ -130,12 +185,12 @@ executables: []
|
|
130
185
|
extensions: []
|
131
186
|
extra_rdoc_files: []
|
132
187
|
files:
|
133
|
-
- ".codeclimate.yml"
|
134
188
|
- ".github/issue_template.md"
|
135
189
|
- ".github/pull_request_template.md"
|
136
|
-
- ".github/workflows/
|
190
|
+
- ".github/workflows/release-please.yml"
|
137
191
|
- ".github/workflows/ruby.yml"
|
138
192
|
- ".gitignore"
|
193
|
+
- ".release-please-manifest.json"
|
139
194
|
- ".rubocop.yml"
|
140
195
|
- ".simplecov"
|
141
196
|
- CHANGELOG.md
|
@@ -144,6 +199,7 @@ files:
|
|
144
199
|
- LICENSE
|
145
200
|
- README.md
|
146
201
|
- Rakefile
|
202
|
+
- checksums/roo-2.10.1.gem.sha512
|
147
203
|
- examples/roo_soap_client.rb
|
148
204
|
- examples/roo_soap_server.rb
|
149
205
|
- examples/write_me.rb
|
@@ -189,6 +245,7 @@ files:
|
|
189
245
|
- lib/roo/tempdir.rb
|
190
246
|
- lib/roo/utils.rb
|
191
247
|
- lib/roo/version.rb
|
248
|
+
- release-please-config.json
|
192
249
|
- roo.gemspec
|
193
250
|
- spec/fixtures/vcr_cassettes/google_drive.yml
|
194
251
|
- spec/fixtures/vcr_cassettes/google_drive_access_token.yml
|
@@ -240,8 +297,8 @@ files:
|
|
240
297
|
homepage: https://github.com/roo-rb/roo
|
241
298
|
licenses:
|
242
299
|
- MIT
|
243
|
-
metadata:
|
244
|
-
|
300
|
+
metadata:
|
301
|
+
changelog_uri: https://github.com/roo-rb/roo/blob/master/CHANGELOG.md
|
245
302
|
rdoc_options: []
|
246
303
|
require_paths:
|
247
304
|
- lib
|
@@ -249,15 +306,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
249
306
|
requirements:
|
250
307
|
- - ">="
|
251
308
|
- !ruby/object:Gem::Version
|
252
|
-
version:
|
309
|
+
version: 3.1.0
|
253
310
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
254
311
|
requirements:
|
255
312
|
- - ">="
|
256
313
|
- !ruby/object:Gem::Version
|
257
314
|
version: '0'
|
258
315
|
requirements: []
|
259
|
-
rubygems_version: 3.
|
260
|
-
signing_key:
|
316
|
+
rubygems_version: 3.6.9
|
261
317
|
specification_version: 4
|
262
318
|
summary: Roo can access the contents of various spreadsheet files.
|
263
319
|
test_files: []
|
data/.codeclimate.yml
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
name: Changelog
|
2
|
-
|
3
|
-
on:
|
4
|
-
pull_request:
|
5
|
-
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]
|
6
|
-
|
7
|
-
jobs:
|
8
|
-
changelog:
|
9
|
-
runs-on: ubuntu-latest
|
10
|
-
steps:
|
11
|
-
- uses: actions/checkout@v2
|
12
|
-
- uses: amoniacou/changelog-enforcer@v1.4.0
|
13
|
-
with:
|
14
|
-
changeLogPath: 'CHANGELOG.md'
|
15
|
-
skipLabel: 'Skip-Changelog'
|