ooxl 0.0.1.5.6 → 0.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 +4 -4
- data/.circleci/config.yml +47 -0
- data/.github/ISSUE_TEMPLATE/bug_report.md +35 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +23 -0
- data/.github/PULL_REQUEST_TEMPLATE.md +10 -0
- data/CHANGELOG.md +22 -0
- data/CODE_OF_CONDUCT.md +11 -0
- data/CONTRIBUTING.md +63 -0
- data/LICENSE.txt +21 -0
- data/README.md +135 -80
- data/SECURITY.md +26 -0
- data/lib/ooxl/version.rb +1 -1
- data/ooxl.gemspec +44 -0
- metadata +50 -25
- data/.travis.yml +0 -5
- data/ooxml_excel.gemspec +0 -35
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c8acac0faaf7f8422ad1b587ea9927e5726573ca0a2b81f3aa084bd8c445873f
|
|
4
|
+
data.tar.gz: 176ebd1c0adb1f1fc53555373f3c1bc0b4aa642d517e9ce92bcbf2e8345bf617
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 88428f412d46cafc61861b6b5085fc19df152bc3f7c75d4eafdf4f6b88c2776b4222f171e9168913f4680abfd809259f98f63567b6d12bb12d4459e10cb7b1a6
|
|
7
|
+
data.tar.gz: 46741c38cff1b5b84c254d92c55dffb50f23f6632a931b810ddb838c3e82b9875674d7fccaf7be568fc288265bd6e784461d4b908a458b69886c523833db67e1
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
version: 2.1
|
|
2
|
+
|
|
3
|
+
workflows:
|
|
4
|
+
build:
|
|
5
|
+
jobs:
|
|
6
|
+
- build:
|
|
7
|
+
matrix:
|
|
8
|
+
parameters:
|
|
9
|
+
ruby_version:
|
|
10
|
+
- 3.2.7
|
|
11
|
+
- 3.3.8
|
|
12
|
+
- 3.4.1
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
build:
|
|
16
|
+
parameters:
|
|
17
|
+
ruby_version:
|
|
18
|
+
type: string
|
|
19
|
+
docker:
|
|
20
|
+
- image: ruby:<< parameters.ruby_version >>
|
|
21
|
+
environment:
|
|
22
|
+
CIRCLE_TEST_REPORTS: "test-results"
|
|
23
|
+
working_directory: ~/ooxl
|
|
24
|
+
steps:
|
|
25
|
+
- checkout
|
|
26
|
+
- restore_cache:
|
|
27
|
+
keys:
|
|
28
|
+
- v1-gems-ruby-<< parameters.ruby_version >>-{{ checksum "ooxl.gemspec" }}-{{ checksum "Gemfile" }}
|
|
29
|
+
- v1-gems-ruby-<< parameters.ruby_version >>-
|
|
30
|
+
- run:
|
|
31
|
+
name: Install Gems
|
|
32
|
+
command: |
|
|
33
|
+
bundle config set path 'vendor/bundle'
|
|
34
|
+
if ! bundle check; then
|
|
35
|
+
bundle install --jobs=4 --retry=3
|
|
36
|
+
bundle clean
|
|
37
|
+
fi
|
|
38
|
+
- save_cache:
|
|
39
|
+
key: v1-gems-ruby-<< parameters.ruby_version >>-{{ checksum "ooxl.gemspec" }}-{{ checksum "Gemfile" }}
|
|
40
|
+
paths:
|
|
41
|
+
- "vendor/bundle"
|
|
42
|
+
- run:
|
|
43
|
+
name: Run Tests
|
|
44
|
+
command: |
|
|
45
|
+
bundle exec rspec --format RspecJunitFormatter --out $CIRCLE_TEST_REPORTS/rspec/junit.xml --format progress spec
|
|
46
|
+
- store_test_results:
|
|
47
|
+
path: "test-results"
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug Report
|
|
3
|
+
about: Report a bug to help us improve OOXL
|
|
4
|
+
title: ''
|
|
5
|
+
labels: bug
|
|
6
|
+
assignees: ''
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Description
|
|
10
|
+
|
|
11
|
+
A clear and concise description of the bug.
|
|
12
|
+
|
|
13
|
+
## Steps to Reproduce
|
|
14
|
+
|
|
15
|
+
1. ...
|
|
16
|
+
2. ...
|
|
17
|
+
3. ...
|
|
18
|
+
|
|
19
|
+
## Expected Behavior
|
|
20
|
+
|
|
21
|
+
What you expected to happen.
|
|
22
|
+
|
|
23
|
+
## Actual Behavior
|
|
24
|
+
|
|
25
|
+
What actually happened. Include error messages or stack traces if applicable.
|
|
26
|
+
|
|
27
|
+
## Environment
|
|
28
|
+
|
|
29
|
+
- **OOXL version:**
|
|
30
|
+
- **Ruby version:**
|
|
31
|
+
- **OS:**
|
|
32
|
+
|
|
33
|
+
## Additional Context
|
|
34
|
+
|
|
35
|
+
Add any other context about the problem here, such as a sample `.xlsx` file (if possible and non-sensitive).
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature Request
|
|
3
|
+
about: Suggest an idea for OOXL
|
|
4
|
+
title: ''
|
|
5
|
+
labels: enhancement
|
|
6
|
+
assignees: ''
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Problem
|
|
10
|
+
|
|
11
|
+
A clear and concise description of the problem or limitation you're experiencing.
|
|
12
|
+
|
|
13
|
+
## Proposed Solution
|
|
14
|
+
|
|
15
|
+
Describe the solution you'd like to see.
|
|
16
|
+
|
|
17
|
+
## Alternatives Considered
|
|
18
|
+
|
|
19
|
+
Describe any alternative solutions or workarounds you've considered.
|
|
20
|
+
|
|
21
|
+
## Additional Context
|
|
22
|
+
|
|
23
|
+
Add any other context, examples, or screenshots about the feature request here.
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## Unreleased
|
|
4
|
+
- Add `allowed_push_host` to gemspec metadata.
|
|
5
|
+
- Update CircleCI config to add changelog check.
|
|
6
|
+
- Rename gemspec from `ooxml_excel.gemspec` to `ooxl.gemspec`.
|
|
7
|
+
- Lower required Ruby version from `>= 3.3` to `>= 3.2` to match release environment.
|
|
8
|
+
|
|
9
|
+
## 0.1.0 - 2026-03-23
|
|
10
|
+
- Parse Excel spreadsheets (`.xlsx`, `.xlsm`) from file paths, strings, and IO objects.
|
|
11
|
+
- Sheet access by name with hidden sheet filtering.
|
|
12
|
+
- Row and cell access by index and cell reference (e.g. `A1`).
|
|
13
|
+
- Cell values, formulas, types (string, number, boolean, date, formula, inline_str).
|
|
14
|
+
- Cell ranges and named ranges with 1D and 2D array returns.
|
|
15
|
+
- Column definitions with hidden and width properties.
|
|
16
|
+
- Merged cell detection.
|
|
17
|
+
- Style access (fonts and fills) per cell.
|
|
18
|
+
- Data validations per sheet and per cell.
|
|
19
|
+
- Comment extraction.
|
|
20
|
+
- Padded rows and padded cells options for gap filling.
|
|
21
|
+
- Lazy row loading via row cache for large files.
|
|
22
|
+
- CircleCI for Ruby 3.3, 3.4.
|
data/CODE_OF_CONDUCT.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
This project has adopted the [Contributor Covenant v2.1](https://www.contributor-covenant.org/version/2/1/code_of_conduct/) as its Code of Conduct.
|
|
4
|
+
|
|
5
|
+
The full text is available at: https://www.contributor-covenant.org/version/2/1/code_of_conduct/
|
|
6
|
+
|
|
7
|
+
## Reporting
|
|
8
|
+
|
|
9
|
+
Instances of behavior that violates the Code of Conduct may be reported to the project maintainer at **jmones@salsify.com**.
|
|
10
|
+
|
|
11
|
+
All reports will be reviewed and investigated promptly and fairly. The maintainer is obligated to respect the privacy and security of the reporter.
|
data/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Contributing to OOXL
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing to OOXL! This document provides guidelines and instructions for contributing.
|
|
4
|
+
|
|
5
|
+
## Development Setup
|
|
6
|
+
|
|
7
|
+
1. Fork and clone the repository:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
git clone https://github.com/<your-username>/ooxl.git
|
|
11
|
+
cd ooxl
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
2. Install dependencies:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
bin/setup
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
3. Verify everything works:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
bundle exec rake spec
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
4. Open an interactive console to experiment:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
bin/console
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Running Tests
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
bundle exec rake spec
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
All tests must pass before a pull request can be merged. CI runs the test suite against Ruby 3.3 and 3.4 via CircleCI.
|
|
39
|
+
|
|
40
|
+
## Branch and PR Conventions
|
|
41
|
+
|
|
42
|
+
1. Create a feature branch from `master`:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
git checkout -b my-feature master
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
2. Make your changes in small, focused commits.
|
|
49
|
+
|
|
50
|
+
3. Push your branch and open a pull request against `master`.
|
|
51
|
+
|
|
52
|
+
4. Fill out the pull request template, including a description of the change, whether tests were added, and whether the changelog was updated.
|
|
53
|
+
|
|
54
|
+
## Code Style
|
|
55
|
+
|
|
56
|
+
- Follow standard Ruby conventions and the patterns already established in the codebase.
|
|
57
|
+
- Keep methods short and focused.
|
|
58
|
+
- Add tests for any new functionality or bug fixes.
|
|
59
|
+
- Update `CHANGELOG.md` under the `[Unreleased]` section when making user-facing changes.
|
|
60
|
+
|
|
61
|
+
## Code of Conduct
|
|
62
|
+
|
|
63
|
+
This project follows the [Contributor Covenant Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.
|
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 James Mones
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
data/README.md
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
# OOXL
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://badge.fury.io/rb/ooxl)
|
|
4
|
+
[](https://circleci.com/gh/salsify/ooxl)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
[](https://www.ruby-lang.org)
|
|
7
|
+
|
|
8
|
+
A lightweight Ruby library for parsing Excel spreadsheets (`.xlsx`, `.xlsm`). Extract sheet data, cell values, formulas, styles, comments, data validations, and named ranges with a simple API.
|
|
4
9
|
|
|
5
10
|
## Installation
|
|
6
11
|
|
|
@@ -12,7 +17,7 @@ gem 'ooxl'
|
|
|
12
17
|
|
|
13
18
|
And then execute:
|
|
14
19
|
|
|
15
|
-
$ bundle
|
|
20
|
+
$ bundle install
|
|
16
21
|
|
|
17
22
|
Or install it yourself as:
|
|
18
23
|
|
|
@@ -20,132 +25,182 @@ Or install it yourself as:
|
|
|
20
25
|
|
|
21
26
|
## Usage
|
|
22
27
|
|
|
23
|
-
###
|
|
24
|
-
```
|
|
25
|
-
ooxl = OOXL.new('example.xlsx')
|
|
26
|
-
|
|
27
|
-
or
|
|
28
|
+
### Opening a Spreadsheet
|
|
28
29
|
|
|
30
|
+
```ruby
|
|
31
|
+
# From a file path
|
|
32
|
+
ooxl = OOXL.new('example.xlsx')
|
|
33
|
+
# or
|
|
29
34
|
ooxl = OOXL.open('example.xlsx')
|
|
30
|
-
```
|
|
31
35
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
ooxl.sheets # ['Test Sheet 1', 'Test Sheet 2']
|
|
36
|
+
# From a string or IO stream (e.g. uploaded file, HTTP response)
|
|
37
|
+
ooxl = OOXL.parse(file_contents)
|
|
35
38
|
```
|
|
36
39
|
|
|
37
|
-
###
|
|
40
|
+
### Options
|
|
41
|
+
|
|
42
|
+
```ruby
|
|
43
|
+
ooxl = OOXL.open('example.xlsx',
|
|
44
|
+
skip_hidden_sheets: true, # exclude hidden sheets from iteration
|
|
45
|
+
padded_rows: true, # fill gaps in row indices with empty rows
|
|
46
|
+
padded_cells: true # fill gaps in columns with blank cells
|
|
47
|
+
)
|
|
38
48
|
```
|
|
39
|
-
sheet = ooxl.sheet('Test Sheet 1')
|
|
40
49
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
50
|
+
### Sheets
|
|
51
|
+
|
|
52
|
+
```ruby
|
|
53
|
+
ooxl.sheets # => ["Sheet 1", "Sheet 2"]
|
|
54
|
+
ooxl.sheets(skip_hidden: true) # exclude hidden sheets
|
|
44
55
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
sheet
|
|
56
|
+
sheet = ooxl.sheet('Sheet 1')
|
|
57
|
+
# or
|
|
58
|
+
sheet = ooxl['Sheet 1']
|
|
59
|
+
```
|
|
48
60
|
|
|
49
|
-
|
|
50
|
-
sheet[0][0] # short version
|
|
61
|
+
### Rows and Cells
|
|
51
62
|
|
|
52
|
-
|
|
53
|
-
sheet[
|
|
63
|
+
```ruby
|
|
64
|
+
sheet = ooxl['Sheet 1']
|
|
54
65
|
|
|
55
|
-
#
|
|
56
|
-
|
|
66
|
+
# Access rows by index
|
|
67
|
+
sheet.rows # all rows
|
|
68
|
+
sheet.rows[0] # first row
|
|
69
|
+
sheet[0] # shorthand
|
|
57
70
|
|
|
58
|
-
#
|
|
59
|
-
|
|
71
|
+
# Access cells
|
|
72
|
+
sheet[0].cells # all cells in the first row
|
|
73
|
+
sheet[0][0] # first cell of the first row
|
|
74
|
+
sheet[0][0].value # cell value
|
|
60
75
|
|
|
61
|
-
#
|
|
62
|
-
|
|
76
|
+
# Access a cell directly by reference
|
|
77
|
+
cell = sheet.cell('C1')
|
|
78
|
+
cell.value # => "some value"
|
|
79
|
+
cell.column # => "C"
|
|
80
|
+
cell.row # => "1"
|
|
81
|
+
cell.type # => :string, :number, :boolean, :date, :formula, :inline_str
|
|
82
|
+
cell.formula # => formula string, or nil
|
|
63
83
|
```
|
|
64
84
|
|
|
65
85
|
### Iteration
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
86
|
+
|
|
87
|
+
```ruby
|
|
88
|
+
# Iterate over rows in a sheet
|
|
89
|
+
ooxl['Sheet 1'].each do |row|
|
|
90
|
+
row.each do |cell|
|
|
91
|
+
puts cell.value
|
|
70
92
|
end
|
|
71
93
|
end
|
|
72
94
|
|
|
95
|
+
# Iterate over all sheets
|
|
73
96
|
ooxl.each do |sheet|
|
|
74
97
|
sheet.each do |row|
|
|
75
98
|
row.each do |cell|
|
|
76
|
-
|
|
99
|
+
puts cell.value
|
|
77
100
|
end
|
|
78
101
|
end
|
|
79
102
|
end
|
|
80
103
|
```
|
|
81
104
|
|
|
82
|
-
###
|
|
83
|
-
```
|
|
84
|
-
# Fetch all columns
|
|
85
|
-
ooxl.sheet('Test Sheet 1').columns
|
|
105
|
+
### Cell Ranges and Named Ranges
|
|
86
106
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
ooxl.
|
|
90
|
-
```
|
|
107
|
+
```ruby
|
|
108
|
+
# Named range
|
|
109
|
+
ooxl.named_range('my_named_range') # => ["value1", "value2", "value3"]
|
|
91
110
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
#
|
|
102
|
-
|
|
103
|
-
fill_object.bg_color # FFE10000
|
|
104
|
-
fill_object.fg_color # FFE10000
|
|
111
|
+
# Cell range (column)
|
|
112
|
+
ooxl['Lists!A1:A6'] # => ["1", "2", "3", "4", "5", "6"]
|
|
113
|
+
|
|
114
|
+
# Single cell
|
|
115
|
+
ooxl['Lists!A1'] # => ["1"]
|
|
116
|
+
|
|
117
|
+
# Rectangle (returns 2D array)
|
|
118
|
+
ooxl['Lists!A1:B2'] # => [["1", "2"], ["3", "4"]]
|
|
119
|
+
|
|
120
|
+
# Entire column
|
|
121
|
+
ooxl['Lists!A:A'] # => ["1", "2", "3", "4", "5", "6"]
|
|
105
122
|
```
|
|
106
|
-
|
|
123
|
+
|
|
124
|
+
### Columns
|
|
125
|
+
|
|
126
|
+
```ruby
|
|
127
|
+
sheet = ooxl['Sheet 1']
|
|
128
|
+
|
|
129
|
+
sheet.columns # all column definitions
|
|
130
|
+
sheet.column('A') # by letter
|
|
131
|
+
sheet.column(1) # by index
|
|
132
|
+
sheet.column('A').hidden?
|
|
133
|
+
sheet.column('A').width
|
|
107
134
|
```
|
|
108
|
-
# named range
|
|
109
|
-
ooxl.named_range('my_named_range') # ['value' 'from', 'range']
|
|
110
135
|
|
|
111
|
-
|
|
112
|
-
ooxml['Lists'!$A$1:$A$6] # ['1','2','3','4','5','6']
|
|
136
|
+
### Merged Cells
|
|
113
137
|
|
|
114
|
-
|
|
115
|
-
|
|
138
|
+
```ruby
|
|
139
|
+
sheet.in_merged_cells?('C1') # => true / false
|
|
140
|
+
```
|
|
116
141
|
|
|
117
|
-
|
|
118
|
-
ooxml['Lists'!A1] # ['1']
|
|
142
|
+
### Styles
|
|
119
143
|
|
|
120
|
-
|
|
121
|
-
|
|
144
|
+
```ruby
|
|
145
|
+
# Font
|
|
146
|
+
font = ooxl['Sheet 1'].font('A1')
|
|
147
|
+
font.name # => "Arial"
|
|
148
|
+
font.size # => "8"
|
|
149
|
+
font.rgb_color # => "FFE10000"
|
|
150
|
+
font.bold? # => false
|
|
122
151
|
|
|
123
|
-
#
|
|
124
|
-
|
|
152
|
+
# Cell fill
|
|
153
|
+
fill = ooxl['Sheet 1'].fill('A1')
|
|
154
|
+
fill.pattern_type # => "solid"
|
|
155
|
+
fill.fg_color # => "FFE10000"
|
|
156
|
+
fill.bg_color # => "FFE10000"
|
|
157
|
+
```
|
|
125
158
|
|
|
159
|
+
### Data Validations
|
|
126
160
|
|
|
161
|
+
```ruby
|
|
162
|
+
# All validations on a sheet
|
|
163
|
+
validations = ooxl['Sheet 1'].data_validations
|
|
127
164
|
|
|
165
|
+
# Validation for a specific cell
|
|
166
|
+
validation = ooxl['Input Sheet'].data_validation('D4')
|
|
167
|
+
validation.type # => "textLength"
|
|
168
|
+
validation.formula # => "20"
|
|
169
|
+
validation.prompt # => "Sample Validation Message"
|
|
128
170
|
```
|
|
129
|
-
|
|
171
|
+
|
|
172
|
+
### Comments
|
|
173
|
+
|
|
174
|
+
```ruby
|
|
175
|
+
sheet = ooxl['Sheet 1']
|
|
176
|
+
sheet.comment('A1') # => comment text, or nil
|
|
130
177
|
```
|
|
131
|
-
# All Validations
|
|
132
|
-
data_validations = ooxl.sheet('Test Sheet 1').data_validations
|
|
133
178
|
|
|
134
|
-
|
|
135
|
-
data_validation = ooxml.sheet('Input Sheet').data_validation('D4')
|
|
179
|
+
For full API details, see the [source documentation](https://github.com/salsify/ooxl).
|
|
136
180
|
|
|
137
|
-
|
|
138
|
-
data_validation.formula # 20
|
|
139
|
-
data_validation.type #textLength
|
|
181
|
+
## Development
|
|
140
182
|
|
|
183
|
+
```bash
|
|
184
|
+
# Install dependencies
|
|
185
|
+
bin/setup
|
|
186
|
+
|
|
187
|
+
# Run the test suite
|
|
188
|
+
bundle exec rake spec
|
|
189
|
+
|
|
190
|
+
# Open an interactive console
|
|
191
|
+
bin/console
|
|
141
192
|
```
|
|
142
193
|
|
|
143
|
-
|
|
194
|
+
CI runs automatically via CircleCI on push and pull requests against `master`, testing Ruby 3.3 and 3.4.
|
|
144
195
|
|
|
145
|
-
|
|
196
|
+
## Status
|
|
146
197
|
|
|
147
|
-
|
|
198
|
+
Tested with Ruby 3.3 and 3.4 on MRI.
|
|
148
199
|
|
|
149
200
|
## Contributing
|
|
150
201
|
|
|
151
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
|
202
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/salsify/ooxl. See [CONTRIBUTING.md](CONTRIBUTING.md) for details.
|
|
203
|
+
|
|
204
|
+
## License
|
|
205
|
+
|
|
206
|
+
This gem is available as open source under the terms of the [MIT License](LICENSE.txt).
|
data/SECURITY.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Reporting a Vulnerability
|
|
4
|
+
|
|
5
|
+
If you discover a security vulnerability in OOXL, please report it responsibly.
|
|
6
|
+
|
|
7
|
+
**Do not open a public GitHub issue for security vulnerabilities.**
|
|
8
|
+
|
|
9
|
+
Instead, please email **jmones@salsify.com** with:
|
|
10
|
+
|
|
11
|
+
- A description of the vulnerability
|
|
12
|
+
- Steps to reproduce the issue
|
|
13
|
+
- The potential impact
|
|
14
|
+
- Any suggested fixes (optional)
|
|
15
|
+
|
|
16
|
+
You should receive an acknowledgment within 48 hours. We will work with you to understand the issue and coordinate a fix and disclosure timeline.
|
|
17
|
+
|
|
18
|
+
## Supported Versions
|
|
19
|
+
|
|
20
|
+
| Version | Supported |
|
|
21
|
+
| ------- | ------------------ |
|
|
22
|
+
| 0.1.x | :white_check_mark: |
|
|
23
|
+
|
|
24
|
+
## Scope
|
|
25
|
+
|
|
26
|
+
This policy covers the `ooxl` Ruby gem and its source code at https://github.com/halcjames/ooxl. Since OOXL parses user-supplied Excel files, we are particularly interested in reports related to XML parsing, zip extraction, and input handling.
|
data/lib/ooxl/version.rb
CHANGED
data/ooxl.gemspec
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
+
require 'ooxl/version'
|
|
5
|
+
|
|
6
|
+
Gem::Specification.new do |spec|
|
|
7
|
+
spec.name = "ooxl"
|
|
8
|
+
spec.version = OOXL::VERSION
|
|
9
|
+
spec.authors = ["James Mones"]
|
|
10
|
+
spec.email = ["jmones@salsify.com"]
|
|
11
|
+
spec.summary = %q{Lightweight Ruby parser for Excel spreadsheets (xlsx, xlsm).}
|
|
12
|
+
spec.description = %q{Parse Excel spreadsheets with a simple API. Read cell values, formulas, styles, comments, data validations, named ranges, and merged cells from xlsx and xlsm files. Supports streaming from strings and IO objects with lazy row loading for large files.}
|
|
13
|
+
spec.homepage = "https://github.com/salsify/ooxl"
|
|
14
|
+
spec.license = "MIT"
|
|
15
|
+
spec.required_ruby_version = ">= 3.2"
|
|
16
|
+
|
|
17
|
+
spec.metadata = {
|
|
18
|
+
"source_code_uri" => "https://github.com/salsify/ooxl",
|
|
19
|
+
"bug_tracker_uri" => "https://github.com/salsify/ooxl/issues",
|
|
20
|
+
"changelog_uri" => "https://github.com/salsify/ooxl/blob/master/CHANGELOG.md",
|
|
21
|
+
"rubygems_mfa_required" => "true"
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if spec.respond_to?(:metadata)
|
|
25
|
+
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
|
26
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
|
27
|
+
else
|
|
28
|
+
raise 'RubyGems 2.0 or newer is required to set allowed_push_host.'
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
32
|
+
spec.bindir = "exe"
|
|
33
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
34
|
+
spec.require_paths = ["lib"]
|
|
35
|
+
spec.add_dependency 'activesupport'
|
|
36
|
+
spec.add_dependency 'nokogiri', '~> 1'
|
|
37
|
+
spec.add_dependency 'rubyzip', '~> 2.0'
|
|
38
|
+
|
|
39
|
+
spec.add_development_dependency "bundler"
|
|
40
|
+
spec.add_development_dependency "pry-byebug"
|
|
41
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
|
42
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
|
43
|
+
spec.add_development_dependency "rspec_junit_formatter"
|
|
44
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ooxl
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- James Mones
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-04-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|
|
@@ -44,20 +44,14 @@ dependencies:
|
|
|
44
44
|
requirements:
|
|
45
45
|
- - "~>"
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
|
-
version:
|
|
48
|
-
- - "<"
|
|
49
|
-
- !ruby/object:Gem::Version
|
|
50
|
-
version: 2.0.0
|
|
47
|
+
version: '2.0'
|
|
51
48
|
type: :runtime
|
|
52
49
|
prerelease: false
|
|
53
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
54
51
|
requirements:
|
|
55
52
|
- - "~>"
|
|
56
53
|
- !ruby/object:Gem::Version
|
|
57
|
-
version:
|
|
58
|
-
- - "<"
|
|
59
|
-
- !ruby/object:Gem::Version
|
|
60
|
-
version: 2.0.0
|
|
54
|
+
version: '2.0'
|
|
61
55
|
- !ruby/object:Gem::Dependency
|
|
62
56
|
name: bundler
|
|
63
57
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -92,14 +86,14 @@ dependencies:
|
|
|
92
86
|
requirements:
|
|
93
87
|
- - "~>"
|
|
94
88
|
- !ruby/object:Gem::Version
|
|
95
|
-
version: '
|
|
89
|
+
version: '13.0'
|
|
96
90
|
type: :development
|
|
97
91
|
prerelease: false
|
|
98
92
|
version_requirements: !ruby/object:Gem::Requirement
|
|
99
93
|
requirements:
|
|
100
94
|
- - "~>"
|
|
101
95
|
- !ruby/object:Gem::Version
|
|
102
|
-
version: '
|
|
96
|
+
version: '13.0'
|
|
103
97
|
- !ruby/object:Gem::Dependency
|
|
104
98
|
name: rspec
|
|
105
99
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -114,19 +108,44 @@ dependencies:
|
|
|
114
108
|
- - "~>"
|
|
115
109
|
- !ruby/object:Gem::Version
|
|
116
110
|
version: '3.0'
|
|
117
|
-
|
|
111
|
+
- !ruby/object:Gem::Dependency
|
|
112
|
+
name: rspec_junit_formatter
|
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
|
114
|
+
requirements:
|
|
115
|
+
- - ">="
|
|
116
|
+
- !ruby/object:Gem::Version
|
|
117
|
+
version: '0'
|
|
118
|
+
type: :development
|
|
119
|
+
prerelease: false
|
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
121
|
+
requirements:
|
|
122
|
+
- - ">="
|
|
123
|
+
- !ruby/object:Gem::Version
|
|
124
|
+
version: '0'
|
|
125
|
+
description: Parse Excel spreadsheets with a simple API. Read cell values, formulas,
|
|
126
|
+
styles, comments, data validations, named ranges, and merged cells from xlsx and
|
|
127
|
+
xlsm files. Supports streaming from strings and IO objects with lazy row loading
|
|
128
|
+
for large files.
|
|
118
129
|
email:
|
|
119
|
-
-
|
|
130
|
+
- jmones@salsify.com
|
|
120
131
|
executables: []
|
|
121
132
|
extensions: []
|
|
122
133
|
extra_rdoc_files: []
|
|
123
134
|
files:
|
|
135
|
+
- ".circleci/config.yml"
|
|
136
|
+
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
|
137
|
+
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
|
138
|
+
- ".github/PULL_REQUEST_TEMPLATE.md"
|
|
124
139
|
- ".gitignore"
|
|
125
140
|
- ".rspec"
|
|
126
|
-
-
|
|
141
|
+
- CHANGELOG.md
|
|
142
|
+
- CODE_OF_CONDUCT.md
|
|
143
|
+
- CONTRIBUTING.md
|
|
127
144
|
- Gemfile
|
|
145
|
+
- LICENSE.txt
|
|
128
146
|
- README.md
|
|
129
147
|
- Rakefile
|
|
148
|
+
- SECURITY.md
|
|
130
149
|
- bin/console
|
|
131
150
|
- bin/setup
|
|
132
151
|
- lib/ooxl.rb
|
|
@@ -149,11 +168,17 @@ files:
|
|
|
149
168
|
- lib/ooxl/xl_objects/styles.rb
|
|
150
169
|
- lib/ooxl/xl_objects/table.rb
|
|
151
170
|
- lib/ooxl/xl_objects/workbook.rb
|
|
152
|
-
-
|
|
153
|
-
homepage: https://github.com/
|
|
154
|
-
licenses:
|
|
155
|
-
|
|
156
|
-
|
|
171
|
+
- ooxl.gemspec
|
|
172
|
+
homepage: https://github.com/salsify/ooxl
|
|
173
|
+
licenses:
|
|
174
|
+
- MIT
|
|
175
|
+
metadata:
|
|
176
|
+
source_code_uri: https://github.com/salsify/ooxl
|
|
177
|
+
bug_tracker_uri: https://github.com/salsify/ooxl/issues
|
|
178
|
+
changelog_uri: https://github.com/salsify/ooxl/blob/master/CHANGELOG.md
|
|
179
|
+
rubygems_mfa_required: 'true'
|
|
180
|
+
allowed_push_host: https://rubygems.org
|
|
181
|
+
post_install_message:
|
|
157
182
|
rdoc_options: []
|
|
158
183
|
require_paths:
|
|
159
184
|
- lib
|
|
@@ -161,15 +186,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
161
186
|
requirements:
|
|
162
187
|
- - ">="
|
|
163
188
|
- !ruby/object:Gem::Version
|
|
164
|
-
version: '
|
|
189
|
+
version: '3.2'
|
|
165
190
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
166
191
|
requirements:
|
|
167
192
|
- - ">="
|
|
168
193
|
- !ruby/object:Gem::Version
|
|
169
194
|
version: '0'
|
|
170
195
|
requirements: []
|
|
171
|
-
rubygems_version: 3.
|
|
172
|
-
signing_key:
|
|
196
|
+
rubygems_version: 3.4.1
|
|
197
|
+
signing_key:
|
|
173
198
|
specification_version: 4
|
|
174
|
-
summary:
|
|
199
|
+
summary: Lightweight Ruby parser for Excel spreadsheets (xlsx, xlsm).
|
|
175
200
|
test_files: []
|
data/.travis.yml
DELETED
data/ooxml_excel.gemspec
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
-
require 'ooxl/version'
|
|
5
|
-
|
|
6
|
-
Gem::Specification.new do |spec|
|
|
7
|
-
spec.name = "ooxl"
|
|
8
|
-
spec.version = OOXL::VERSION
|
|
9
|
-
spec.authors = ["James Mones"]
|
|
10
|
-
spec.email = ["bajong009@gmail.com"]
|
|
11
|
-
spec.summary = %q{OOXL Excel - Parse Excel Spreadsheets (xlsx, xlsm).}
|
|
12
|
-
spec.description = %q{A Ruby spreadsheet parser for Excel (xlsx, xlsm).}
|
|
13
|
-
spec.homepage = "https://github.com/halcjames/ooxl"
|
|
14
|
-
|
|
15
|
-
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
|
16
|
-
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
|
17
|
-
# if spec.respond_to?(:metadata)
|
|
18
|
-
# spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
|
|
19
|
-
# else
|
|
20
|
-
# raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
|
|
21
|
-
# end
|
|
22
|
-
|
|
23
|
-
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
24
|
-
spec.bindir = "exe"
|
|
25
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
26
|
-
spec.require_paths = ["lib"]
|
|
27
|
-
spec.add_dependency 'activesupport'
|
|
28
|
-
spec.add_dependency 'nokogiri', '~> 1'
|
|
29
|
-
spec.add_dependency 'rubyzip', '~> 1.3.0', '< 2.0.0'
|
|
30
|
-
|
|
31
|
-
spec.add_development_dependency "bundler"
|
|
32
|
-
spec.add_development_dependency "pry-byebug"
|
|
33
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
|
34
|
-
spec.add_development_dependency "rspec", "~> 3.0"
|
|
35
|
-
end
|