xsv 1.4.0 → 1.4.1
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/workflows/release.yml +39 -0
- data/CHANGELOG.md +5 -0
- data/lib/xsv/sheet.rb +18 -6
- data/lib/xsv/sheet_bounds_handler.rb +1 -1
- data/lib/xsv/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a0fb3d682de516914c72424844559dc8ac53ef4a3ba0b906c90f44261b2411fd
|
|
4
|
+
data.tar.gz: ca269e4b84ea4c5cb865d1cd5599cf18740e840f9f26d575f2065688950b7d2a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2cd6b2190e84323f58e2efc1cf8ff91ae625c9febb366886d4530178d1e0c5644ca10584fe237dff8f77e8644c300b874e2feabc32116293fbd9bd63514ed272
|
|
7
|
+
data.tar.gz: f27435b037cbc53d772dd57923f9f38aa4a3becd4f8c96d4ad7f79df45fac29ee804c0c62b0a57cf69f019f04304ae95c6229f3ed8f8cb7fcb7d8caa460bfbc3
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*'
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: write
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
release:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
with:
|
|
17
|
+
fetch-depth: 0 # Fetch all history for changelog generation
|
|
18
|
+
|
|
19
|
+
- name: Create GitHub Release
|
|
20
|
+
env:
|
|
21
|
+
GH_TOKEN: ${{ github.token }}
|
|
22
|
+
run: |
|
|
23
|
+
# Extract version from tag
|
|
24
|
+
VERSION=${GITHUB_REF#refs/tags/}
|
|
25
|
+
|
|
26
|
+
# Generate release notes from commits since previous tag
|
|
27
|
+
PREV_TAG=$(git describe --tags --abbrev=0 ${VERSION}^ 2>/dev/null || echo "")
|
|
28
|
+
|
|
29
|
+
if [ -n "$PREV_TAG" ]; then
|
|
30
|
+
NOTES=$(git log ${PREV_TAG}..${VERSION} --pretty=format:"- %s (%h)" --no-merges)
|
|
31
|
+
else
|
|
32
|
+
NOTES="Initial release"
|
|
33
|
+
fi
|
|
34
|
+
|
|
35
|
+
# Create the release
|
|
36
|
+
gh release create ${VERSION} \
|
|
37
|
+
--title "${VERSION}" \
|
|
38
|
+
--notes "${NOTES}" \
|
|
39
|
+
--verify-tag
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Xsv Changelog
|
|
2
2
|
|
|
3
|
+
## 1.4.1 2026-04-11
|
|
4
|
+
|
|
5
|
+
- Add Range support to Sheet#[] (thanks @paddor)
|
|
6
|
+
- Fix SheetBoundsHandler to detect rows with inlineStr cells (thanks @kikumiyako)
|
|
7
|
+
|
|
3
8
|
## 1.4.0 2026-01-29
|
|
4
9
|
|
|
5
10
|
- Ruby 2.7, 3.0, and 3.1 are no longer supported. Xsv is now compatible with Ruby 3.2 through 4.0, latest JRuby, and latest TruffleRuby
|
data/lib/xsv/sheet.rb
CHANGED
|
@@ -64,14 +64,26 @@ module Xsv
|
|
|
64
64
|
|
|
65
65
|
alias_method :each, :each_row
|
|
66
66
|
|
|
67
|
-
# Get row by number, starting at 0. Returns either a hash or an array
|
|
67
|
+
# Get row by number or a range of rows, starting at 0. Returns either a hash or an array
|
|
68
|
+
# based on the current mode. When called with a Range, returns an array of rows.
|
|
68
69
|
# If the specified index is out of bounds an empty row is returned.
|
|
69
|
-
def [](
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
def [](number_or_range)
|
|
71
|
+
case number_or_range
|
|
72
|
+
when Range
|
|
73
|
+
rows = []
|
|
74
|
+
each_with_index do |row, i|
|
|
75
|
+
rows << row if number_or_range.cover?(i)
|
|
76
|
+
end
|
|
77
|
+
rows
|
|
78
|
+
when Integer
|
|
79
|
+
each_with_index do |row, i|
|
|
80
|
+
return row if i == number_or_range
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
empty_row
|
|
84
|
+
else
|
|
85
|
+
raise ArgumentError, "Expected Integer or Range, got #{number_or_range.class}"
|
|
72
86
|
end
|
|
73
|
-
|
|
74
|
-
empty_row
|
|
75
87
|
end
|
|
76
88
|
|
|
77
89
|
# Load headers in the top row of the worksheet. After parsing of headers
|
data/lib/xsv/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: xsv
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.4.
|
|
4
|
+
version: 1.4.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Martijn Storck
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-
|
|
10
|
+
date: 2026-04-11 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: rubyzip
|
|
@@ -96,6 +96,7 @@ executables: []
|
|
|
96
96
|
extensions: []
|
|
97
97
|
extra_rdoc_files: []
|
|
98
98
|
files:
|
|
99
|
+
- ".github/workflows/release.yml"
|
|
99
100
|
- ".github/workflows/ruby.yml"
|
|
100
101
|
- ".gitignore"
|
|
101
102
|
- ".standard.yml"
|