fast_xlsx 0.1.2-x86_64-linux → 0.2.0-x86_64-linux
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/CHANGELOG.md +13 -0
- data/README.md +45 -1
- data/bench/Gemfile.lock +2 -2
- data/lib/fast_xlsx/3.3/fast_xlsx.so +2 -2
- data/lib/fast_xlsx/3.4/fast_xlsx.so +2 -2
- data/lib/fast_xlsx/4.0/fast_xlsx.so +2 -2
- data/lib/fast_xlsx/version.rb +1 -1
- data/lib/fast_xlsx.rb +115 -16
- data/sig/fast_xlsx.rbs +20 -4
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 385d5c9b69ab08b516cfa1f99e4075b691b9a264924c32498303f4d577abfeaa
|
|
4
|
+
data.tar.gz: 3c28e89e17339b7f2077d0be122eddf858789be99acd9d18a404c044e309ee44
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 02670f7b5ebf4a2cf27955651de5a9a7409202700871cdd493f73788de50c7a0e8cb37d0732f8e5ad99ab13fd9017b4f452fac96c5cb6c361e203e4793c35dc0
|
|
7
|
+
data.tar.gz: 3744269cbb53e37c8519a5df27a196d0fbab8672f8ca985a24c74c06486f326707cd1c2f5303ef7498f994ce7f695ff905745f5c31e38db9eb08dd4c9937d308
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [0.2.0] - 2026-10-01
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Range methods (`autofilter`, `merge_range`, `conditional_format`, `data_validation`, `add_table`) also take an Excel reference (`"A1:D10"`) or rows and columns as Integers or Ranges (`0..9, 0..3`).
|
|
8
|
+
- `Workbook#define_name` for workbook-wide and sheet-scoped defined names.
|
|
9
|
+
- `Worksheet#group_rows` and `#group_columns` (outline groups, optionally collapsed); `group_rows` raises in `:constant` / `:low` mode.
|
|
10
|
+
- `Worksheet#protect(password:, allow:)` locks a sheet; `Format` options `locked: false` and `hidden: true` keep cells editable or hide formulas.
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- `column_width`, `column_format` and the other methods that take a Range raise `ArgumentError` for an empty, reversed or endless Range, or one that isn't Integers, instead of a `TypeError` or `RangeError`.
|
|
15
|
+
|
|
3
16
|
## [0.1.2] - 2026-09-30
|
|
4
17
|
|
|
5
18
|
### Fixed
|
data/README.md
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# FastXlsx
|
|
2
2
|
|
|
3
|
+
[](https://badge.fury.io/rb/fast_xlsx)
|
|
3
4
|
[](https://codecov.io/gh/7a6163/fast_xlsx)
|
|
4
5
|
|
|
5
6
|
Fast `.xlsx` writer for Ruby, built on [rust_xlsxwriter](https://github.com/jmcnamara/rust_xlsxwriter) via [magnus](https://github.com/matsadler/magnus).
|
|
@@ -75,6 +76,8 @@ ws.write(1, 2, Date.today, date) # format one cell
|
|
|
75
76
|
| `valign` | `:top`, `:center`, `:bottom` |
|
|
76
77
|
| `border`, `border_left`, `border_right`, `border_top`, `border_bottom` | `:thin`, `:medium`, `:thick`, `:dashed`, `:dotted`, `:double`, `:hair` |
|
|
77
78
|
| `border_color` | `"#RRGGBB"` or `0xRRGGBB` |
|
|
79
|
+
| `locked` | `false` keeps the cell editable on a protected sheet (default `true`) |
|
|
80
|
+
| `hidden` | `true` hides the cell's formula on a protected sheet |
|
|
78
81
|
|
|
79
82
|
Per-side borders override `border`. Unknown options and invalid values raise `ArgumentError`.
|
|
80
83
|
|
|
@@ -85,7 +88,18 @@ ws.column_width(0, 20) # column A, width in characters
|
|
|
85
88
|
ws.column_width(1..3, 12) # columns B–D
|
|
86
89
|
ws.column_format(4, FastXlsx::Format.new(num_format: "#,##0.00")) # default for cells in E written without a format
|
|
87
90
|
ws.autofit # size other columns to the data written so far; set widths are kept
|
|
88
|
-
ws.autofilter(
|
|
91
|
+
ws.autofilter("A1:D101") # filter buttons on A1:D101
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Cell ranges
|
|
95
|
+
|
|
96
|
+
`autofilter`, `merge_range`, `conditional_format`, `data_validation` and `add_table` take a range in any of these styles:
|
|
97
|
+
|
|
98
|
+
```ruby
|
|
99
|
+
ws.autofilter(0, 0, 100, 3) # four 0-based numbers: first_row, first_col, last_row, last_col
|
|
100
|
+
ws.autofilter("A1:D101") # an Excel reference; "$A$1:$D$101" and a single "B2" work too
|
|
101
|
+
ws.autofilter(0..100, 0..3) # rows and columns, each an Integer or a Range
|
|
102
|
+
ws.merge_range(0, 0..3, "Q3 report", title) # row 1, columns A–D
|
|
89
103
|
```
|
|
90
104
|
|
|
91
105
|
`autofit` only sees rows still in memory, so in `:constant` / `:low` memory mode it ignores rows already written to disk; set widths with `column_width` instead.
|
|
@@ -103,6 +117,36 @@ ws.page_footer("&L&A", margin: 0.2) # sheet name on the left; margin
|
|
|
103
117
|
ws.margins(left: 0.5, top: 1) # other margins keep Excel's defaults
|
|
104
118
|
```
|
|
105
119
|
|
|
120
|
+
### Outline groups
|
|
121
|
+
|
|
122
|
+
```ruby
|
|
123
|
+
ws.group_rows(1..10) # rows 2–11 get an expand/collapse button
|
|
124
|
+
ws.group_rows(1..4) # grouping again nests them (up to 7 levels)
|
|
125
|
+
ws.group_columns(2..3, collapsed: true) # columns C–D, collapsed until expanded
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
`group_rows` needs `memory: :standard`: in `:constant` / `:low` mode rust_xlsxwriter writes rows without their outline level, so it raises. `group_columns` works in every mode.
|
|
129
|
+
|
|
130
|
+
### Defined names
|
|
131
|
+
|
|
132
|
+
```ruby
|
|
133
|
+
wb.define_name("Rate", "=0.96") # workbook-wide; use as =A1*Rate
|
|
134
|
+
wb.define_name("Report!Sales", "=Report!$B$2:$B$13") # only on the Report sheet
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Invalid names raise `FastXlsx::Error` right away; duplicate names, and names for a sheet that doesn't exist, raise when saving.
|
|
138
|
+
|
|
139
|
+
### Protection
|
|
140
|
+
|
|
141
|
+
```ruby
|
|
142
|
+
input = FastXlsx::Format.new(locked: false)
|
|
143
|
+
ws.write(1, 1, 0, input) # B2 stays editable
|
|
144
|
+
ws.protect # lock everything else
|
|
145
|
+
ws.protect(password: "secret", allow: %i[sort use_autofilter]) # or with a password and allowed actions
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
`allow:` takes `:format_cells`, `:format_columns`, `:format_rows`, `:insert_columns`, `:insert_rows`, `:insert_links`, `:delete_columns`, `:delete_rows`, `:sort`, `:use_autofilter`, `:use_pivot_tables`, `:edit_scenarios`, `:edit_objects`. The password only stops editing in Excel; it does not encrypt the file.
|
|
149
|
+
|
|
106
150
|
### Conditional formats
|
|
107
151
|
|
|
108
152
|
```ruby
|
data/bench/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: ..
|
|
3
3
|
specs:
|
|
4
|
-
fast_xlsx (0.
|
|
4
|
+
fast_xlsx (0.2.0)
|
|
5
5
|
rb_sys (~> 0.9.130)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
@@ -77,7 +77,7 @@ DEPENDENCIES
|
|
|
77
77
|
CHECKSUMS
|
|
78
78
|
caxlsx (4.5.0) sha256=e3d98d859f148df05d5462086b5079b523f29c1766b569535f1d68629ce743ff
|
|
79
79
|
fast_excel (0.5.0) sha256=59c418bdcf586a6030798d4e3a9f575742badaceaf7bb90f38eee5feb5bdc478
|
|
80
|
-
fast_xlsx (0.
|
|
80
|
+
fast_xlsx (0.2.0)
|
|
81
81
|
ffi (1.17.4-aarch64-linux-gnu) sha256=b208f06f91ffd8f5e1193da3cae3d2ccfc27fc36fba577baf698d26d91c080df
|
|
82
82
|
ffi (1.17.4-aarch64-linux-musl) sha256=9286b7a615f2676245283aef0a0a3b475ae3aae2bb5448baace630bb77b91f39
|
|
83
83
|
ffi (1.17.4-arm-linux-gnu) sha256=d6dbddf7cb77bf955411af5f187a65b8cd378cb003c15c05697f5feee1cb1564
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: data/lib/fast_xlsx/3.3/fast_xlsx.so
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 45375128 bytes
|
|
4
|
+
sha256: 043624848d4e4d9f2b26792a9593ea1fb0efe93072ede8d879f9b3b80e5e6f87
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: data/lib/fast_xlsx/3.4/fast_xlsx.so
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 45453952 bytes
|
|
4
|
+
sha256: bdd409fc4cb74c8f2a099f0f8878e5288dc1cd645ded3cedfa1b520ee22197df
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: data/lib/fast_xlsx/4.0/fast_xlsx.so
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 45431888 bytes
|
|
4
|
+
sha256: f71f589703ec307fbb068f251dbc8d39e7f6ee850962b93cd1b9fc253ded2728
|
data/lib/fast_xlsx/version.rb
CHANGED
data/lib/fast_xlsx.rb
CHANGED
|
@@ -113,11 +113,11 @@ module FastXlsx
|
|
|
113
113
|
|
|
114
114
|
# columns: a 0-based column index or a Range of them. width is in characters.
|
|
115
115
|
def column_width(columns, width)
|
|
116
|
-
|
|
117
|
-
_column_width(*
|
|
116
|
+
range = CellRange.bounds(columns)
|
|
117
|
+
_column_width(*range, width)
|
|
118
118
|
@fixed_widths ||= {}
|
|
119
|
-
@fixed_widths.delete(
|
|
120
|
-
@fixed_widths[
|
|
119
|
+
@fixed_widths.delete(range) # re-insert so autofit replays calls in order
|
|
120
|
+
@fixed_widths[range] = width
|
|
121
121
|
self
|
|
122
122
|
end
|
|
123
123
|
|
|
@@ -129,21 +129,32 @@ module FastXlsx
|
|
|
129
129
|
self
|
|
130
130
|
end
|
|
131
131
|
|
|
132
|
+
# The methods below take a cell range in any of these styles:
|
|
133
|
+
# (first_row, first_col, last_row, last_col) four 0-based numbers
|
|
134
|
+
# ("A1:D10") or ("B2") an Excel reference
|
|
135
|
+
# (rows, cols) Integers or Ranges, e.g. (0..9, 0..3)
|
|
136
|
+
|
|
137
|
+
# Filter buttons on the range's first row.
|
|
138
|
+
def autofilter(*range)
|
|
139
|
+
_autofilter(*CellRange.split(range).first)
|
|
140
|
+
end
|
|
141
|
+
|
|
132
142
|
# Merges the range and writes value (any cell type) into its first cell.
|
|
133
|
-
def merge_range(
|
|
134
|
-
|
|
143
|
+
def merge_range(*args)
|
|
144
|
+
range, (value, format) = CellRange.split(args, 1..2)
|
|
145
|
+
_merge_range(*range, value, format)
|
|
135
146
|
end
|
|
136
147
|
|
|
137
148
|
# Highlights cells in the range by rule. type: :cell, :text, :formula,
|
|
138
149
|
# :data_bar or :color_scale; see the README for each type's options.
|
|
139
|
-
def conditional_format(
|
|
140
|
-
_conditional_format(
|
|
150
|
+
def conditional_format(*range, type:, **)
|
|
151
|
+
_conditional_format(*CellRange.split(range).first, { type: type, ** })
|
|
141
152
|
end
|
|
142
153
|
|
|
143
154
|
# Restricts what can be entered in the range. type: :list, :whole_number,
|
|
144
155
|
# :decimal or :text_length; see the README for the options.
|
|
145
|
-
def data_validation(
|
|
146
|
-
_data_validation(
|
|
156
|
+
def data_validation(*range, type:, **)
|
|
157
|
+
_data_validation(*CellRange.split(range).first, { type: type, ** })
|
|
147
158
|
end
|
|
148
159
|
|
|
149
160
|
# Adds a comment (Excel "note") to a cell.
|
|
@@ -170,8 +181,8 @@ module FastXlsx
|
|
|
170
181
|
# into an Excel table. columns: header Strings or { header:, total:,
|
|
171
182
|
# total_label:, format: }; other options: style:, name:, total_row:,
|
|
172
183
|
# banded_rows:, autofilter:.
|
|
173
|
-
def add_table(
|
|
174
|
-
_add_table(
|
|
184
|
+
def add_table(*range, **)
|
|
185
|
+
_add_table(*CellRange.split(range).first, { ** })
|
|
175
186
|
end
|
|
176
187
|
|
|
177
188
|
# Printed page header/footer using Excel codes such as "&CPage &P of &N".
|
|
@@ -192,18 +203,106 @@ module FastXlsx
|
|
|
192
203
|
self
|
|
193
204
|
end
|
|
194
205
|
|
|
206
|
+
# Outline group with an expand/collapse button. rows: a 0-based row index
|
|
207
|
+
# or a Range; grouping rows already grouped nests them (up to 7 levels).
|
|
208
|
+
# collapsed: true hides them until expanded.
|
|
209
|
+
def group_rows(rows, collapsed: false)
|
|
210
|
+
_group_rows(*CellRange.bounds(rows), collapsed)
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
def group_columns(columns, collapsed: false)
|
|
214
|
+
_group_columns(*CellRange.bounds(columns), collapsed)
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
# Locks the sheet against editing. Cells whose format has locked: false
|
|
218
|
+
# stay editable. allow: actions users may still take, any of :format_cells,
|
|
219
|
+
# :format_columns, :format_rows, :insert_columns, :insert_rows,
|
|
220
|
+
# :insert_links, :delete_columns, :delete_rows, :sort, :use_autofilter,
|
|
221
|
+
# :use_pivot_tables, :edit_scenarios, :edit_objects.
|
|
222
|
+
def protect(password: nil, allow: [])
|
|
223
|
+
_protect(password, Array(allow))
|
|
224
|
+
end
|
|
225
|
+
|
|
195
226
|
# Default format for cells in these columns that are written without one.
|
|
196
227
|
def column_format(columns, format)
|
|
197
|
-
_column_format(*
|
|
228
|
+
_column_format(*CellRange.bounds(columns), format)
|
|
198
229
|
self
|
|
199
230
|
end
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
# Cell ranges in the styles Worksheet methods accept: four 0-based numbers,
|
|
234
|
+
# an Excel reference ("A1:D10", "B2"), or rows and columns as Integers or
|
|
235
|
+
# Ranges.
|
|
236
|
+
module CellRange
|
|
237
|
+
REF = /\A\$?([A-Za-z]{1,3})\$?([1-9]\d*)\z/ # ASCII only: /i also matches the Kelvin sign
|
|
238
|
+
FORMS = 'a range is (first_row, first_col, last_row, last_col), "A1:D10" or (rows, cols)'
|
|
239
|
+
|
|
240
|
+
module_function
|
|
241
|
+
|
|
242
|
+
# Splits a range off the front of args and checks how many args follow.
|
|
243
|
+
# Returns [[first_row, first_col, last_row, last_col], the args after it].
|
|
244
|
+
def split(args, following = 0..0)
|
|
245
|
+
range, rest = parse(args)
|
|
246
|
+
unless following.cover?(rest.size)
|
|
247
|
+
expected = following.minmax.uniq.join("..")
|
|
248
|
+
raise ArgumentError, "wrong number of arguments after the cell range (given #{rest.size}, " \
|
|
249
|
+
"expected #{expected}); #{FORMS}"
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
[range, rest]
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
def parse(args)
|
|
256
|
+
case args
|
|
257
|
+
in [Numeric, Numeric, Numeric, Numeric, *rest] then [args.first(4), rest]
|
|
258
|
+
in [String => ref, *rest] then [excel(ref), rest]
|
|
259
|
+
in [Integer | Range => rows, Integer | Range => cols, *rest]
|
|
260
|
+
[rows_and_cols(rows, cols), rest]
|
|
261
|
+
else
|
|
262
|
+
raise ArgumentError, "expected a cell range, got #{args.inspect}; #{FORMS}"
|
|
263
|
+
end
|
|
264
|
+
end
|
|
265
|
+
|
|
266
|
+
def rows_and_cols(rows, cols)
|
|
267
|
+
first_row, last_row = bounds(rows)
|
|
268
|
+
first_col, last_col = bounds(cols)
|
|
269
|
+
[first_row, first_col, last_row, last_col]
|
|
270
|
+
end
|
|
271
|
+
|
|
272
|
+
# "A1:D10", "$A$1:$D$10" or a single "B2".
|
|
273
|
+
def excel(ref)
|
|
274
|
+
cells = cell_matches(ref)
|
|
275
|
+
rows = cells.map { |m| m[2].to_i - 1 }
|
|
276
|
+
cols = cells.map { |m| column(m[1]) }
|
|
277
|
+
[rows.min, cols.min, rows.max, cols.max]
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
def cell_matches(ref)
|
|
281
|
+
cells = ref.split(":", -1).map { |cell| REF.match(cell) }
|
|
282
|
+
return cells if (1..2).cover?(cells.size) && cells.all?
|
|
283
|
+
|
|
284
|
+
raise ArgumentError, "invalid cell range #{ref.inspect}: use e.g. \"A1:D10\" or \"B2\""
|
|
285
|
+
end
|
|
286
|
+
|
|
287
|
+
# "A" => 0, "AA" => 26.
|
|
288
|
+
def column(letters)
|
|
289
|
+
letters.upcase.each_char.reduce(0) { |n, c| (n * 26) + c.ord - 64 } - 1
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
# [first, last] of an index or a Range.
|
|
293
|
+
def bounds(indexes)
|
|
294
|
+
return [indexes, indexes] if indexes.is_a?(Integer)
|
|
295
|
+
unless indexes.is_a?(Range) && indexes.begin.is_a?(Integer) && indexes.end.is_a?(Integer)
|
|
296
|
+
raise ArgumentError, "expected an Integer or a Range of Integers, got #{indexes.inspect}"
|
|
297
|
+
end
|
|
200
298
|
|
|
201
|
-
|
|
299
|
+
first, last = indexes.minmax
|
|
300
|
+
raise ArgumentError, "empty range #{indexes.inspect}" unless first
|
|
202
301
|
|
|
203
|
-
|
|
204
|
-
columns.is_a?(Integer) ? [columns, columns] : columns.minmax
|
|
302
|
+
[first, last]
|
|
205
303
|
end
|
|
206
304
|
end
|
|
305
|
+
private_constant :CellRange
|
|
207
306
|
|
|
208
307
|
# Cell style, e.g. Format.new(bold: true). Pass to Worksheet#write.
|
|
209
308
|
class Format
|
data/sig/fast_xlsx.rbs
CHANGED
|
@@ -36,6 +36,7 @@ module FastXlsx
|
|
|
36
36
|
?company: String, ?category: String, ?keywords: String,
|
|
37
37
|
?comments: String, ?status: String) -> self
|
|
38
38
|
def to_xlsx: () -> String
|
|
39
|
+
def define_name: (String name, String formula) -> self
|
|
39
40
|
def save: (String | _ToPath path) -> void
|
|
40
41
|
end
|
|
41
42
|
|
|
@@ -46,7 +47,7 @@ module FastXlsx
|
|
|
46
47
|
type underline = bool | :single | :double | :single_accounting | :double_accounting
|
|
47
48
|
|
|
48
49
|
def self.new: (?bold: bool, ?italic: bool, ?underline: underline, ?strikeout: bool, ?text_wrap: bool,
|
|
49
|
-
?shrink: bool, ?num_format: String, ?font_size: Numeric, ?font_name: String,
|
|
50
|
+
?shrink: bool, ?locked: bool, ?hidden: bool, ?num_format: String, ?font_size: Numeric, ?font_name: String,
|
|
50
51
|
?font_color: color, ?bg_color: color, ?font_script: :superscript | :subscript,
|
|
51
52
|
?align: :left | :center | :right, ?valign: :top | :center | :bottom,
|
|
52
53
|
?rotation: Integer, ?indent: Integer,
|
|
@@ -62,7 +63,14 @@ module FastXlsx
|
|
|
62
63
|
def column_width: (Integer | Range[Integer] columns, Numeric width) -> self
|
|
63
64
|
def column_format: (Integer | Range[Integer] columns, Format format) -> self
|
|
64
65
|
def autofit: () -> self
|
|
66
|
+
# A cell range: four 0-based numbers, an Excel reference ("A1:D10"), or
|
|
67
|
+
# rows and columns as Integers or Ranges. Methods with options take it as
|
|
68
|
+
# *cell_range so the keywords can follow.
|
|
69
|
+
type indexes = Integer | Range[Integer]
|
|
70
|
+
type cell_range = Integer | String | Range[Integer]
|
|
65
71
|
def autofilter: (Integer first_row, Integer first_col, Integer last_row, Integer last_col) -> self
|
|
72
|
+
| (String range) -> self
|
|
73
|
+
| (indexes rows, indexes cols) -> self
|
|
66
74
|
def freeze_panes: (Integer row, Integer col) -> self
|
|
67
75
|
def row_height: (Integer row, Numeric height) -> self
|
|
68
76
|
def page_breaks: (Array[Integer] rows) -> self
|
|
@@ -71,12 +79,20 @@ module FastXlsx
|
|
|
71
79
|
def page_footer: (String text, ?margin: Numeric?) -> self
|
|
72
80
|
def margins: (?left: Numeric?, ?right: Numeric?, ?top: Numeric?, ?bottom: Numeric?,
|
|
73
81
|
?header: Numeric?, ?footer: Numeric?) -> self
|
|
82
|
+
type protect_action = :format_cells | :format_columns | :format_rows | :insert_columns | :insert_rows
|
|
83
|
+
| :insert_links | :delete_columns | :delete_rows | :sort | :use_autofilter
|
|
84
|
+
| :use_pivot_tables | :edit_scenarios | :edit_objects
|
|
85
|
+
def group_rows: (Integer | Range[Integer] rows, ?collapsed: bool) -> self
|
|
86
|
+
def group_columns: (Integer | Range[Integer] columns, ?collapsed: bool) -> self
|
|
87
|
+
def protect: (?password: String?, ?allow: protect_action | Array[protect_action] | nil) -> self
|
|
74
88
|
def merge_range: (Integer first_row, Integer first_col, Integer last_row, Integer last_col, cell value, ?Format? format) -> self
|
|
75
|
-
|
|
89
|
+
| (String range, cell value, ?Format? format) -> self
|
|
90
|
+
| (indexes rows, indexes cols, cell value, ?Format? format) -> self
|
|
91
|
+
def conditional_format: (*cell_range range,
|
|
76
92
|
type: :cell | :text | :formula | :data_bar | :color_scale,
|
|
77
93
|
?criteria: Symbol, ?value: Numeric | String | Array[Numeric | String],
|
|
78
94
|
?format: Format, ?colors: 2 | 3) -> self
|
|
79
|
-
def data_validation: (
|
|
95
|
+
def data_validation: (*cell_range range,
|
|
80
96
|
type: :list | :whole_number | :decimal | :text_length,
|
|
81
97
|
?criteria: Symbol, ?value: Numeric | String | Array[Numeric | String],
|
|
82
98
|
?input_title: String, ?input_message: String,
|
|
@@ -91,7 +107,7 @@ module FastXlsx
|
|
|
91
107
|
?width: Integer, ?height: Integer) -> self
|
|
92
108
|
type table_column = String | { header: String, ?total: Symbol, ?total_label: String, ?format: Format }
|
|
93
109
|
|
|
94
|
-
def add_table: (
|
|
110
|
+
def add_table: (*cell_range range,
|
|
95
111
|
?columns: Array[table_column], ?style: Symbol, ?name: String,
|
|
96
112
|
?total_row: bool, ?banded_rows: bool, ?autofilter: bool) -> self
|
|
97
113
|
def name: () -> String
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fast_xlsx
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: x86_64-linux
|
|
6
6
|
authors:
|
|
7
7
|
- Zac
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-10-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Writes Excel .xlsx files from Ruby through a native Rust extension (rust_xlsxwriter
|
|
14
14
|
+ magnus).
|