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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6c27d848984359d8f492658ca2634981f6f05b66c75711ccce305f794ff04530
4
- data.tar.gz: 69cb487a9c42dd09b980f3d1170f39f39f0176109bbdc332c529eab4fbc2a298
3
+ metadata.gz: a0fb3d682de516914c72424844559dc8ac53ef4a3ba0b906c90f44261b2411fd
4
+ data.tar.gz: ca269e4b84ea4c5cb865d1cd5599cf18740e840f9f26d575f2065688950b7d2a
5
5
  SHA512:
6
- metadata.gz: 8001b27aec710a21ce6860bf3b7a9f37dad27ba4cef797df533df8092c3a61a3851836c8504bca3a0bff8f57dafe4ae2ea296ea7a554a9558b3d807ca9f0b62e
7
- data.tar.gz: d397dc3daaccda23e5160fd6b71342fc69c57fed98276da65ef0691908afb751310c3c8f8d6ebc7b6b7b90b4e604a57e635919b7456ae64694703a7c7cf1aab4
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 based on the current row.
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 [](number)
70
- each_with_index do |row, i|
71
- return row if i == number
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
@@ -40,7 +40,7 @@ module Xsv
40
40
  when "c"
41
41
  @state = name
42
42
  @cell = attrs[:r]
43
- when "v"
43
+ when "v", "is"
44
44
  col = column_index(@cell)
45
45
  @max_column = col if col > @max_column
46
46
  @max_row = @row if @row > @max_row
data/lib/xsv/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Xsv
4
- VERSION = "1.4.0"
4
+ VERSION = "1.4.1"
5
5
  end
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.0
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-01-29 00:00:00.000000000 Z
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"