xlsxrb 0.1.17 → 0.2.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/CHANGELOG.md +256 -1
- data/README.md +111 -28
- data/lib/ruby_lsp/xlsxrb/completion_listener.rb +439 -139
- data/lib/xlsxrb/chart_builder.rb +540 -193
- data/lib/xlsxrb/dsl_helpers.rb +178 -73
- data/lib/xlsxrb/elements/cell.rb +197 -130
- data/lib/xlsxrb/elements/column.rb +88 -7
- data/lib/xlsxrb/elements/coordinate_access.rb +86 -59
- data/lib/xlsxrb/elements/image.rb +18 -19
- data/lib/xlsxrb/elements/metadata.rb +2379 -0
- data/lib/xlsxrb/elements/row.rb +84 -118
- data/lib/xlsxrb/elements/styles.rb +140 -90
- data/lib/xlsxrb/elements/types.rb +164 -22
- data/lib/xlsxrb/elements/workbook.rb +122 -140
- data/lib/xlsxrb/elements/worksheet.rb +451 -226
- data/lib/xlsxrb/elements.rb +1 -0
- data/lib/xlsxrb/ooxml/reader/listeners/core_listeners.rb +16 -5
- data/lib/xlsxrb/ooxml/reader/listeners/drawing_listeners.rb +14 -9
- data/lib/xlsxrb/ooxml/reader/listeners/feature_listeners.rb +296 -34
- data/lib/xlsxrb/ooxml/reader/listeners/style_listeners.rb +17 -3
- data/lib/xlsxrb/ooxml/reader.rb +52 -50
- data/lib/xlsxrb/ooxml/styles_parser.rb +36 -5
- data/lib/xlsxrb/ooxml/utils.rb +2 -2
- data/lib/xlsxrb/ooxml/workbook_parser.rb +0 -1
- data/lib/xlsxrb/ooxml/workbook_writer.rb +242 -109
- data/lib/xlsxrb/ooxml/worksheet_parser.rb +63 -31
- data/lib/xlsxrb/ooxml/worksheet_writer.rb +119 -56
- data/lib/xlsxrb/ooxml/writer/drawing_xml.rb +33 -13
- data/lib/xlsxrb/ooxml/writer/features_xml.rb +75 -15
- data/lib/xlsxrb/ooxml/writer/styles_xml.rb +18 -8
- data/lib/xlsxrb/ooxml/writer.rb +124 -44
- data/lib/xlsxrb/ooxml/xml_parser.rb +78 -5
- data/lib/xlsxrb/ooxml/zip_generator.rb +2 -0
- data/lib/xlsxrb/ooxml/zip_reader.rb +112 -25
- data/lib/xlsxrb/ooxml/zip_writer.rb +119 -30
- data/lib/xlsxrb/stream_row.rb +56 -81
- data/lib/xlsxrb/stream_sheet.rb +542 -273
- data/lib/xlsxrb/stream_writer.rb +1536 -870
- data/lib/xlsxrb/style_builder.rb +667 -221
- data/lib/xlsxrb/version.rb +1 -1
- data/lib/xlsxrb/workbook_builder.rb +406 -143
- data/lib/xlsxrb/worksheet_builder.rb +1009 -900
- data/lib/xlsxrb.rb +1179 -1056
- data/sig/generated/xlsxrb/chart_builder.rbs +385 -159
- data/sig/generated/xlsxrb/dsl_helpers.rbs +81 -15
- data/sig/generated/xlsxrb/elements/cell.rbs +78 -70
- data/sig/generated/xlsxrb/elements/column.rbs +55 -3
- data/sig/generated/xlsxrb/elements/coordinate_access.rbs +35 -29
- data/sig/generated/xlsxrb/elements/image.rbs +7 -11
- data/sig/generated/xlsxrb/elements/metadata.rbs +1574 -0
- data/sig/generated/xlsxrb/elements/row.rbs +39 -42
- data/sig/generated/xlsxrb/elements/styles.rbs +66 -66
- data/sig/generated/xlsxrb/elements/types.rbs +27 -0
- data/sig/generated/xlsxrb/elements/workbook.rbs +46 -99
- data/sig/generated/xlsxrb/elements/worksheet.rbs +121 -96
- data/sig/generated/xlsxrb/ooxml/reader/listeners/feature_listeners.rbs +61 -4
- data/sig/generated/xlsxrb/ooxml/reader.rbs +2 -2
- data/sig/generated/xlsxrb/ooxml/styles_parser.rbs +1 -1
- data/sig/generated/xlsxrb/ooxml/utils.rbs +3 -3
- data/sig/generated/xlsxrb/ooxml/workbook_writer.rbs +13 -1
- data/sig/generated/xlsxrb/ooxml/worksheet_parser.rbs +16 -0
- data/sig/generated/xlsxrb/ooxml/worksheet_writer.rbs +6 -4
- data/sig/generated/xlsxrb/ooxml/writer/features_xml.rbs +7 -0
- data/sig/generated/xlsxrb/ooxml/writer.rbs +22 -13
- data/sig/generated/xlsxrb/ooxml/xml_parser.rbs +70 -0
- data/sig/generated/xlsxrb/ooxml/zip_generator.rbs +2 -0
- data/sig/generated/xlsxrb/ooxml/zip_reader.rbs +24 -9
- data/sig/generated/xlsxrb/ooxml/zip_writer.rbs +26 -1
- data/sig/generated/xlsxrb/stream_row.rbs +32 -33
- data/sig/generated/xlsxrb/stream_sheet.rbs +233 -181
- data/sig/generated/xlsxrb/stream_writer.rbs +961 -667
- data/sig/generated/xlsxrb/style_builder.rbs +402 -128
- data/sig/generated/xlsxrb/workbook_builder.rbs +223 -71
- data/sig/generated/xlsxrb/worksheet_builder.rbs +579 -453
- data/sig/generated/xlsxrb.rbs +205 -144
- data/sig/rexml.rbs +8 -0
- metadata +5 -5
- data/lib/xlsxrb/utils.rb +0 -291
- data/sig/generated/xlsxrb/utils.rbs +0 -184
data/sig/generated/xlsxrb.rbs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Modern, streaming-capable, low-memory XLSX reading and writing library for Ruby.
|
|
4
4
|
#
|
|
5
|
-
# Provides high-level facade methods ({Xlsxrb.read}, {Xlsxrb.write}, {Xlsxrb.build}, {Xlsxrb.
|
|
5
|
+
# Provides high-level facade methods ({Xlsxrb.read}, {Xlsxrb.write}, {Xlsxrb.build}, {Xlsxrb.load})
|
|
6
6
|
# with full ECMA-376 OpenXML compliance, MS-OFFCRYPTO password protection, and zero core dependencies.
|
|
7
7
|
#
|
|
8
8
|
# @api public
|
|
@@ -11,27 +11,20 @@ module Xlsxrb
|
|
|
11
11
|
MAX_ROW: ::Integer
|
|
12
12
|
|
|
13
13
|
# Maximum number of columns supported by Excel / OpenXML.
|
|
14
|
-
|
|
14
|
+
MAX_COLUMN: ::Integer
|
|
15
15
|
|
|
16
16
|
# Maximum number of individual cell/range references allowed in a single data validation element by Excel.
|
|
17
17
|
MAX_REFS_PER_VALIDATION: ::Integer
|
|
18
18
|
|
|
19
|
-
#
|
|
20
|
-
|
|
21
|
-
class Error < StandardError
|
|
22
|
-
DIV0: untyped
|
|
23
|
-
|
|
24
|
-
NA: untyped
|
|
25
|
-
|
|
26
|
-
NAME: untyped
|
|
27
|
-
|
|
28
|
-
NULL: untyped
|
|
19
|
+
# <workbookProtection> attributes and the Elements::WorkbookProtection members they load into.
|
|
20
|
+
WORKBOOK_PROTECTION_ATTRIBUTES: untyped
|
|
29
21
|
|
|
30
|
-
|
|
22
|
+
# ZIP deflate level used when no compression_level is given.
|
|
23
|
+
# See docs/adr/0009-default-zip-compression-level.md.
|
|
24
|
+
DEFAULT_COMPRESSION_LEVEL: ::Integer
|
|
31
25
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
VALUE: untyped
|
|
26
|
+
# Base class for all exceptions raised by Xlsxrb.
|
|
27
|
+
class Error < StandardError
|
|
35
28
|
end
|
|
36
29
|
|
|
37
30
|
# Raised when parsing malformed or invalid XML structures.
|
|
@@ -108,45 +101,43 @@ module Xlsxrb
|
|
|
108
101
|
# @param type [Symbol, String, nil] Formula type (:shared, :array, etc.).
|
|
109
102
|
# @param ref [String, nil] Target cell or range reference (e.g. "A1:C1").
|
|
110
103
|
# @param shared_index [Integer, nil] Shared formula group index (0-based).
|
|
111
|
-
# @param si [Integer, nil] Alias for shared_index.
|
|
112
104
|
# @return [Elements::Formula]
|
|
113
105
|
# @api public
|
|
114
|
-
#
|
|
115
|
-
|
|
116
|
-
def self.formula: (String expression, ?cached_value: String | Numeric | bool | Elements::CellError | nil, ?type: (Symbol | String)?, ?ref: String?, ?shared_index: Integer?, ?si: Integer?) -> Elements::Formula
|
|
106
|
+
# : (String expression, ?cached_value: (String | Numeric | bool | Elements::CellError | nil), ?type: (Symbol | String)?, ?ref: String?, ?shared_index: Integer?) -> Elements::Formula
|
|
107
|
+
def self.formula: (String expression, ?cached_value: String | Numeric | bool | Elements::CellError | nil, ?type: (Symbol | String)?, ?ref: String?, ?shared_index: Integer?) -> Elements::Formula
|
|
117
108
|
|
|
118
109
|
# Creates a shared formula {Elements::Formula} object for master or follower cell.
|
|
119
110
|
#
|
|
120
111
|
# @example Create a shared formula master
|
|
121
|
-
# formula = Xlsxrb.shared_formula("A2*2",
|
|
112
|
+
# formula = Xlsxrb.shared_formula("A2*2", shared_index: 0, ref: "B2:B10")
|
|
122
113
|
#
|
|
123
114
|
# @example Create a shared formula follower
|
|
124
|
-
# formula = Xlsxrb.shared_formula(
|
|
115
|
+
# formula = Xlsxrb.shared_formula(shared_index: 0)
|
|
125
116
|
#
|
|
126
117
|
# @param expression [String, nil] The formula expression (nil for follower cells).
|
|
127
|
-
# @param
|
|
118
|
+
# @param shared_index [Integer, nil] Shared formula group index (0-based).
|
|
128
119
|
# @param ref [String, nil] Target range for master cell (e.g. "B2:B10").
|
|
129
120
|
# @param cached_value [Object, nil] Optional precomputed value.
|
|
130
121
|
# @return [Elements::Formula]
|
|
131
122
|
# @api public
|
|
132
|
-
# : (?String? expression,
|
|
133
|
-
def self.shared_formula: (?String? expression,
|
|
123
|
+
# : (?String? expression, ?shared_index: Integer?, ?ref: String?, ?cached_value: (String | Numeric | bool | Elements::CellError | nil)) -> Elements::Formula
|
|
124
|
+
def self.shared_formula: (?String? expression, ?shared_index: Integer?, ?ref: String?, ?cached_value: String | Numeric | bool | Elements::CellError | nil) -> Elements::Formula
|
|
134
125
|
|
|
135
126
|
# Creates an array or dynamic array {Elements::Formula} object.
|
|
136
127
|
#
|
|
137
128
|
# @example Create a multi-cell array formula
|
|
138
|
-
# formula = Xlsxrb.array_formula("SUM(B1:B10*C1:C10)", "A1:C1", cached_value: 0)
|
|
129
|
+
# formula = Xlsxrb.array_formula("SUM(B1:B10*C1:C10)", ref: "A1:C1", cached_value: 0)
|
|
139
130
|
#
|
|
140
131
|
# @example Create a dynamic array formula
|
|
141
|
-
# formula = Xlsxrb.array_formula("SORT(UNIQUE(A1:A10))", "D1")
|
|
132
|
+
# formula = Xlsxrb.array_formula("SORT(UNIQUE(A1:A10))", ref: "D1")
|
|
142
133
|
#
|
|
143
134
|
# @param expression [String] The formula expression without leading '='.
|
|
144
|
-
# @param ref [String, nil] Target cell or range reference (
|
|
135
|
+
# @param ref [String, nil] Target cell or range reference (keyword).
|
|
145
136
|
# @param cached_value [Object, nil] Optional precomputed value.
|
|
146
137
|
# @return [Elements::Formula]
|
|
147
138
|
# @api public
|
|
148
|
-
# : (String expression, ?String
|
|
149
|
-
def self.array_formula: (String expression, ?String
|
|
139
|
+
# : (String expression, ?ref: String?, ?cached_value: (String | Numeric | bool | Elements::CellError | nil), **untyped attrs) -> Elements::Formula
|
|
140
|
+
def self.array_formula: (String expression, ?ref: String?, ?cached_value: String | Numeric | bool | Elements::CellError | nil, **untyped attrs) -> Elements::Formula
|
|
150
141
|
|
|
151
142
|
# Creates an {Elements::Hyperlink} object for use in cell hyperlinks.
|
|
152
143
|
#
|
|
@@ -165,6 +156,32 @@ module Xlsxrb
|
|
|
165
156
|
# : (?String? url, ?display: String?, ?tooltip: String?, ?location: String?) -> Elements::Hyperlink
|
|
166
157
|
def self.hyperlink: (?String? url, ?display: String?, ?tooltip: String?, ?location: String?) -> Elements::Hyperlink
|
|
167
158
|
|
|
159
|
+
# Creates an {Elements::Comment} object for use in cell comments.
|
|
160
|
+
#
|
|
161
|
+
# @example Create a cell comment
|
|
162
|
+
# comment = Xlsxrb.comment("Review this value", author: "Auditor")
|
|
163
|
+
#
|
|
164
|
+
# @param text [String, nil] Comment body text.
|
|
165
|
+
# @param author [String] Comment author.
|
|
166
|
+
# @param visible [Boolean] Whether comment is visible by default.
|
|
167
|
+
# @param ref [String, nil] Cell coordinate (e.g. "A1").
|
|
168
|
+
# @return [Elements::Comment]
|
|
169
|
+
# @api public
|
|
170
|
+
# : (?String? text, ?author: String, ?visible: bool, ?ref: String?, **untyped extra) -> Elements::Comment
|
|
171
|
+
def self.comment: (?String? text, ?author: String, ?visible: bool, ?ref: String?, **untyped extra) -> Elements::Comment
|
|
172
|
+
|
|
173
|
+
# Creates or returns an {Elements::CellError} object.
|
|
174
|
+
#
|
|
175
|
+
# @example
|
|
176
|
+
# err = Xlsxrb.cell_error("#VALUE!")
|
|
177
|
+
# err = Xlsxrb.cell_error(:value)
|
|
178
|
+
#
|
|
179
|
+
# @param code [String, Symbol, Elements::CellError] Error code or symbol.
|
|
180
|
+
# @return [Elements::CellError]
|
|
181
|
+
# @api public
|
|
182
|
+
# : (String | Symbol | Elements::CellError code) -> Elements::CellError
|
|
183
|
+
def self.cell_error: (String | Symbol | Elements::CellError code) -> Elements::CellError
|
|
184
|
+
|
|
168
185
|
# Formats a cell value according to an Excel format code string.
|
|
169
186
|
#
|
|
170
187
|
# @param value [Object, nil] Value to format.
|
|
@@ -173,7 +190,7 @@ module Xlsxrb
|
|
|
173
190
|
# @return [String] Formatted string representation.
|
|
174
191
|
# @api public
|
|
175
192
|
# : (untyped value, ?String? format_code, ?date1904: bool) -> String
|
|
176
|
-
def self.
|
|
193
|
+
def self.format_value: (untyped value, ?String? format_code, ?date1904: bool) -> String
|
|
177
194
|
|
|
178
195
|
# Converts a Date or Time to an Excel numeric serial number (1900 or 1904 system).
|
|
179
196
|
#
|
|
@@ -215,14 +232,14 @@ module Xlsxrb
|
|
|
215
232
|
# Converts a Time or Date to a fractional Excel serial number.
|
|
216
233
|
#
|
|
217
234
|
# @example
|
|
218
|
-
# Xlsxrb.
|
|
235
|
+
# Xlsxrb.time_to_serial(Time.utc(2026, 1, 1, 12, 0, 0)) #=> 46023.5
|
|
219
236
|
#
|
|
220
237
|
# @param time [Time, Date] Time or Date instance.
|
|
221
238
|
# @param date1904 [Boolean] Whether to use the 1904 date system.
|
|
222
239
|
# @return [Float] Fractional serial number.
|
|
223
240
|
# @api public
|
|
224
241
|
# : (Time | Date time, ?date1904: bool) -> Float
|
|
225
|
-
def self.
|
|
242
|
+
def self.time_to_serial: (Time | Date time, ?date1904: bool) -> Float
|
|
226
243
|
|
|
227
244
|
# Converts an Excel serial number to a Time (UTC).
|
|
228
245
|
#
|
|
@@ -236,7 +253,54 @@ module Xlsxrb
|
|
|
236
253
|
# : (Numeric serial, ?date1904: bool) -> Time
|
|
237
254
|
def self.serial_to_time: (Numeric serial, ?date1904: bool) -> Time
|
|
238
255
|
|
|
239
|
-
|
|
256
|
+
# Converts a cell reference string (e.g. "A1", "BC100") to 0-based [row, col] coordinates.
|
|
257
|
+
#
|
|
258
|
+
# @example
|
|
259
|
+
# Xlsxrb.parse_ref("A1") #=> [0, 0]
|
|
260
|
+
# Xlsxrb.parse_ref("BC100") #=> [99, 54]
|
|
261
|
+
#
|
|
262
|
+
# @param ref [String, nil] Excel cell reference string.
|
|
263
|
+
# @return [Array(Integer, Integer), nil] 0-based [row, col] tuple, or nil if invalid.
|
|
264
|
+
# @api public
|
|
265
|
+
# : (String? ref) -> [Integer, Integer]?
|
|
266
|
+
def self.parse_ref: (String? ref) -> [ Integer, Integer ]?
|
|
267
|
+
|
|
268
|
+
# Converts 0-based [row, col] coordinates to an A1-style reference string.
|
|
269
|
+
#
|
|
270
|
+
# @example
|
|
271
|
+
# Xlsxrb.cell_to_ref(0, 0) #=> "A1"
|
|
272
|
+
# Xlsxrb.cell_to_ref(99, 54) #=> "BC100"
|
|
273
|
+
#
|
|
274
|
+
# @param row [Integer] 0-based row index.
|
|
275
|
+
# @param column [Integer] 0-based column index.
|
|
276
|
+
# @return [String] A1-style reference string.
|
|
277
|
+
# @api public
|
|
278
|
+
# : (Integer row, Integer column) -> String
|
|
279
|
+
def self.cell_to_ref: (Integer row, Integer column) -> String
|
|
280
|
+
|
|
281
|
+
# Converts a column letter (e.g. "A", :AA) to a 0-based column index.
|
|
282
|
+
#
|
|
283
|
+
# @example
|
|
284
|
+
# Xlsxrb.column_index("A") #=> 0
|
|
285
|
+
# Xlsxrb.column_index(:AA) #=> 26
|
|
286
|
+
#
|
|
287
|
+
# @param col [String, Symbol, Integer] Column letter or integer index.
|
|
288
|
+
# @return [Integer] 0-based column index.
|
|
289
|
+
# @api public
|
|
290
|
+
# : (String | Symbol | Integer col) -> Integer
|
|
291
|
+
def self.column_index: (String | Symbol | Integer col) -> Integer
|
|
292
|
+
|
|
293
|
+
# Converts a 0-based column index to an Excel letter (0 -> "A", 25 -> "Z", 26 -> "AA").
|
|
294
|
+
#
|
|
295
|
+
# @example
|
|
296
|
+
# Xlsxrb.column_letter(0) #=> "A"
|
|
297
|
+
# Xlsxrb.column_letter(26) #=> "AA"
|
|
298
|
+
#
|
|
299
|
+
# @param index [Integer] 0-based column index.
|
|
300
|
+
# @return [String] Excel column letter.
|
|
301
|
+
# @api public
|
|
302
|
+
# : (Integer index) -> String
|
|
303
|
+
def self.column_letter: (Integer index) -> String
|
|
240
304
|
|
|
241
305
|
# Converts a cell range reference string (e.g. "A1:C10", "A1") to 0-based [[top_row, left_col], [bottom_row, right_col]].
|
|
242
306
|
#
|
|
@@ -250,18 +314,56 @@ module Xlsxrb
|
|
|
250
314
|
def self.parse_range: (String? range_ref) -> [ [ Integer, Integer ], [ Integer, Integer ] ]?
|
|
251
315
|
|
|
252
316
|
# Converts 0-based bounding coordinates to an A1-style range reference string.
|
|
317
|
+
# Accepts either 4 flat integers (top_row, left_column, bottom_row, right_column)
|
|
318
|
+
# or a nested pair ([[top_row, left_column], [bottom_row, right_column]]) as returned by parse_range.
|
|
253
319
|
#
|
|
254
|
-
# @example
|
|
320
|
+
# @example 4 flat integers
|
|
255
321
|
# Xlsxrb.range_to_ref(0, 0, 9, 2) #=> "A1:C10"
|
|
256
322
|
#
|
|
257
|
-
# @
|
|
258
|
-
#
|
|
259
|
-
#
|
|
260
|
-
# @param
|
|
261
|
-
# @
|
|
323
|
+
# @example Nested pair from parse_range
|
|
324
|
+
# Xlsxrb.range_to_ref([[0, 0], [9, 2]]) #=> "A1:C10"
|
|
325
|
+
#
|
|
326
|
+
# @param top_row_or_bounds [Integer, Array] 0-based start row index or nested bounding coordinates.
|
|
327
|
+
# @param left_column [Integer, nil] 0-based start column index.
|
|
328
|
+
# @param bottom_row [Integer, nil] 0-based end row index.
|
|
329
|
+
# @param right_column [Integer, nil] 0-based end column index.
|
|
330
|
+
# @return [String] A1-style range reference string.
|
|
331
|
+
# @api public
|
|
332
|
+
# : (Integer | [[Integer, Integer], [Integer, Integer]] top_row_or_bounds, ?Integer? left_column, ?Integer? bottom_row, ?Integer? right_column) -> String
|
|
333
|
+
def self.range_to_ref: (Integer | [ [ Integer, Integer ], [ Integer, Integer ] ] top_row_or_bounds, ?Integer? left_column, ?Integer? bottom_row, ?Integer? right_column) -> String
|
|
334
|
+
|
|
335
|
+
# Splits an A1-style cell reference into its column name and 1-based row number.
|
|
336
|
+
#
|
|
337
|
+
# @example
|
|
338
|
+
# Xlsxrb.split_coordinate("A1") #=> ["A", 1]
|
|
339
|
+
# Xlsxrb.split_coordinate("BC100") #=> ["BC", 100]
|
|
340
|
+
#
|
|
341
|
+
# @param cell_ref [String, nil] Excel cell reference string.
|
|
342
|
+
# @return [Array(String, Integer), nil] [col_name, row_number] tuple (1-based row), or nil if invalid.
|
|
262
343
|
# @api public
|
|
263
|
-
# : (
|
|
264
|
-
def self.
|
|
344
|
+
# : (String? cell_ref) -> [String, Integer]?
|
|
345
|
+
def self.split_coordinate: (String? cell_ref) -> [ String, Integer ]?
|
|
346
|
+
|
|
347
|
+
FORMULA_TOKEN_RE: ::Regexp
|
|
348
|
+
|
|
349
|
+
# Expands a formula by shifting relative cell references from a master cell to a target cell or by offset amounts.
|
|
350
|
+
#
|
|
351
|
+
# @example Shift formula down one row
|
|
352
|
+
# Xlsxrb.expand_formula("A2*2", row_delta: 1, column_delta: 0) #=> "A3*2"
|
|
353
|
+
# Xlsxrb.expand_formula("A2*2", from_ref: "B2", to_ref: "B3") #=> "A3*2"
|
|
354
|
+
#
|
|
355
|
+
# @example Shift formula with absolute references
|
|
356
|
+
# Xlsxrb.expand_formula("$A$1+A2", row_delta: 2, column_delta: 0) #=> "$A$1+A4"
|
|
357
|
+
#
|
|
358
|
+
# @param formula [String, nil] Formula expression to expand.
|
|
359
|
+
# @param from_ref [String, nil] Master cell reference (e.g. "B2").
|
|
360
|
+
# @param to_ref [String, nil] Target cell reference (e.g. "B3").
|
|
361
|
+
# @param row_delta [Integer, nil] Row shift amount (positive = down, negative = up).
|
|
362
|
+
# @param column_delta [Integer, nil] Column shift amount (positive = right, negative = left).
|
|
363
|
+
# @return [String, nil] Expanded formula expression.
|
|
364
|
+
# @api public
|
|
365
|
+
# : (String? formula, ?from_ref: String?, ?to_ref: String?, ?row_delta: Integer?, ?column_delta: Integer?) -> String?
|
|
366
|
+
def self.expand_formula: (String? formula, ?from_ref: String?, ?to_ref: String?, ?row_delta: Integer?, ?column_delta: Integer?) -> String?
|
|
265
367
|
|
|
266
368
|
# Resolves an ECMA-376 indexed color palette index (0..63) to an RRGGBB hex string (or AARRGGBB if alpha: true).
|
|
267
369
|
#
|
|
@@ -291,8 +393,6 @@ module Xlsxrb
|
|
|
291
393
|
# : (Integer | String | Symbol | nil color, ?alpha: bool) -> String?
|
|
292
394
|
def self.to_hex_color: (Integer | String | Symbol | nil color, ?alpha: bool) -> String?
|
|
293
395
|
|
|
294
|
-
alias self.color_to_hex self.to_hex_color
|
|
295
|
-
|
|
296
396
|
# Sanitizes a worksheet name to ensure it conforms to Excel constraints within 31 characters.
|
|
297
397
|
# Replaces forbidden characters (\ / ? * [ ] : and control characters),
|
|
298
398
|
# replaces leading/trailing apostrophes, and replaces reserved 'History' with 'History_'.
|
|
@@ -308,33 +408,11 @@ module Xlsxrb
|
|
|
308
408
|
# : (untyped name, ?replace_char: String) -> String
|
|
309
409
|
def self.sanitize_sheet_name: (untyped name, ?replace_char: String) -> String
|
|
310
410
|
|
|
311
|
-
alias self.sheet_name self.sanitize_sheet_name
|
|
312
|
-
|
|
313
411
|
# Reads an XLSX file (streaming and lazy-loaded by default) from a file path, IO stream, or binary String.
|
|
314
412
|
#
|
|
315
413
|
# Sheets and rows are streamed lazily with O(1) constant memory. If a block is given,
|
|
316
|
-
# yields each {StreamSheet} sequentially. Call {#load}
|
|
317
|
-
#
|
|
318
|
-
#
|
|
319
|
-
# @overload read(source, password: nil, trim_empty_rows: false, pad_empty_rows: false, pad_empty_cells: false, &block)
|
|
320
|
-
# Yields each {StreamSheet} sequentially in streaming mode.
|
|
321
|
-
# @param source [String, IO, StringIO] File path, binary content string, or readable IO stream.
|
|
322
|
-
# @param password [String, nil] Optional password to decrypt password-protected XLSX files.
|
|
323
|
-
# @param trim_empty_rows [Boolean] Whether to omit trailing empty rows during sheet iteration.
|
|
324
|
-
# @param pad_empty_rows [Boolean] Whether to yield empty rows for skipped row numbers.
|
|
325
|
-
# @param pad_empty_cells [Boolean] Whether to pad missing cells within rows.
|
|
326
|
-
# @yield [sheet]
|
|
327
|
-
# @yieldparam sheet [StreamSheet] The streaming worksheet object.
|
|
328
|
-
# @return [void]
|
|
329
|
-
#
|
|
330
|
-
# @overload read(source, password: nil, trim_empty_rows: false, pad_empty_rows: false, pad_empty_cells: false)
|
|
331
|
-
# Returns a lazy {Elements::Workbook} object.
|
|
332
|
-
# @param source [String, IO, StringIO] File path, binary content string, or readable IO stream.
|
|
333
|
-
# @param password [String, nil] Optional password to decrypt password-protected XLSX files.
|
|
334
|
-
# @param trim_empty_rows [Boolean] Whether to omit trailing empty rows during sheet iteration.
|
|
335
|
-
# @param pad_empty_rows [Boolean] Whether to yield empty rows for skipped row numbers.
|
|
336
|
-
# @param pad_empty_cells [Boolean] Whether to pad missing cells within rows.
|
|
337
|
-
# @return [Elements::Workbook]
|
|
414
|
+
# yields each {StreamSheet} sequentially. Call {StreamSheet#load} to convert a sheet to
|
|
415
|
+
# an in-memory representation for coordinate random access (`sheet["A1"]`).
|
|
338
416
|
#
|
|
339
417
|
# @example Streaming read across sheets and rows (O(1) constant memory)
|
|
340
418
|
# Xlsxrb.read("large.xlsx") do |sheet|
|
|
@@ -344,24 +422,43 @@ module Xlsxrb
|
|
|
344
422
|
# end
|
|
345
423
|
# end
|
|
346
424
|
#
|
|
347
|
-
# @
|
|
348
|
-
#
|
|
349
|
-
#
|
|
350
|
-
#
|
|
351
|
-
#
|
|
352
|
-
#
|
|
425
|
+
# @param source [String, IO, StringIO] File path, binary content string, or readable IO stream.
|
|
426
|
+
# @param password [String, nil] Optional password to decrypt password-protected XLSX files.
|
|
427
|
+
# @param trim_empty_rows [Boolean] Whether to omit trailing empty rows during sheet iteration.
|
|
428
|
+
# @param pad_empty_rows [Boolean] Whether to yield empty rows for skipped row numbers.
|
|
429
|
+
# @param pad_empty_cells [Boolean] Whether to pad missing cells within rows.
|
|
353
430
|
# @param max_uncompressed_size [Integer, nil] Maximum allowed uncompressed size in bytes per entry (ZIP bomb defense).
|
|
431
|
+
# @yield [sheet]
|
|
432
|
+
# @yieldparam sheet [StreamSheet] The streaming worksheet object.
|
|
433
|
+
# @return [Enumerator<StreamSheet>, void]
|
|
354
434
|
# @raise [ZipBombError] If an uncompressed entry exceeds max_uncompressed_size.
|
|
355
435
|
# @raise [EncryptedFileError] If the file is encrypted and no password was supplied.
|
|
356
436
|
# @raise [InvalidPasswordError] If the supplied password is incorrect.
|
|
357
437
|
# @raise [ParseError] If the spreadsheet XML structure is invalid.
|
|
358
438
|
# @api public
|
|
359
439
|
# : (untyped source, ?password: String?, ?trim_empty_rows: bool, ?pad_empty_rows: bool, ?pad_empty_cells: bool, ?max_uncompressed_size: Integer?) { (StreamSheet) -> void } -> void
|
|
360
|
-
# : (untyped source, ?password: String?, ?trim_empty_rows: bool, ?pad_empty_rows: bool, ?pad_empty_cells: bool, ?max_uncompressed_size: Integer?) ->
|
|
440
|
+
# : (untyped source, ?password: String?, ?trim_empty_rows: bool, ?pad_empty_rows: bool, ?pad_empty_cells: bool, ?max_uncompressed_size: Integer?) -> Enumerator[StreamSheet, void]
|
|
361
441
|
def self.read: (untyped source, ?password: String?, ?trim_empty_rows: bool, ?pad_empty_rows: bool, ?pad_empty_cells: bool, ?max_uncompressed_size: Integer?) { (StreamSheet) -> void } -> void
|
|
362
|
-
| (untyped source, ?password: String?, ?trim_empty_rows: bool, ?pad_empty_rows: bool, ?pad_empty_cells: bool, ?max_uncompressed_size: Integer?) ->
|
|
442
|
+
| (untyped source, ?password: String?, ?trim_empty_rows: bool, ?pad_empty_rows: bool, ?pad_empty_cells: bool, ?max_uncompressed_size: Integer?) -> Enumerator[StreamSheet, void]
|
|
363
443
|
|
|
364
|
-
|
|
444
|
+
# Loads all sheets into memory, returning an {Elements::Workbook} where every
|
|
445
|
+
# worksheet is a fully-parsed {Elements::Worksheet} supporting coordinate random access.
|
|
446
|
+
# The underlying zip resources are closed immediately.
|
|
447
|
+
#
|
|
448
|
+
# @example
|
|
449
|
+
# wb = Xlsxrb.load("report.xlsx")
|
|
450
|
+
# puts wb["Sheet1"]["A1"].value
|
|
451
|
+
#
|
|
452
|
+
# @param source [String, IO, StringIO] Path to the .xlsx file or an IO-like stream.
|
|
453
|
+
# @param password [String, nil] Password for decrypting password-protected (ECMA-376 Standard/Agile) workbooks.
|
|
454
|
+
# @param trim_empty_rows [Boolean] Whether to omit trailing empty rows from worksheet data.
|
|
455
|
+
# @param pad_empty_rows [Boolean] Whether to pad missing rows with empty row objects.
|
|
456
|
+
# @param pad_empty_cells [Boolean] Whether to pad missing cells within rows with nil cells.
|
|
457
|
+
# @param max_uncompressed_size [Integer, nil] Maximum uncompressed file size threshold in bytes for zip bomb protection.
|
|
458
|
+
# @return [Elements::Workbook] The fully loaded in-memory workbook.
|
|
459
|
+
# @api public
|
|
460
|
+
# : (untyped source, ?password: String?, ?trim_empty_rows: bool, ?pad_empty_rows: bool, ?pad_empty_cells: bool, ?max_uncompressed_size: Integer?) -> Elements::Workbook
|
|
461
|
+
def self.load: (untyped source, ?password: String?, ?trim_empty_rows: bool, ?pad_empty_rows: bool, ?pad_empty_cells: bool, ?max_uncompressed_size: Integer?) -> Elements::Workbook
|
|
365
462
|
|
|
366
463
|
# Writes an XLSX file or IO stream (streaming or in-memory), or returns a binary string.
|
|
367
464
|
#
|
|
@@ -414,35 +511,11 @@ module Xlsxrb
|
|
|
414
511
|
# When set to `false`, strings are emitted directly as inline strings (`<c t="inlineStr">`), providing flat
|
|
415
512
|
# $O(1)$ constant memory during streaming write. Disabling shared strings is recommended when streaming
|
|
416
513
|
# large datasets where cells contain unique text (e.g. log exports, transaction details).
|
|
417
|
-
# @param compression_level [Integer, nil] ZIP deflate compression level (0..9, or Zlib::DEFAULT_COMPRESSION
|
|
418
|
-
#
|
|
419
|
-
#
|
|
420
|
-
# : (?untyped target_or_workbook, ?Elements::Workbook | untyped workbook_or_nil, ?password: String?, ?encryption_mode: Symbol, ?strict_excel_mode: bool, ?
|
|
421
|
-
def self.write: (?untyped target_or_workbook, ?Elements::Workbook | untyped workbook_or_nil, ?password: String?, ?encryption_mode: Symbol, ?strict_excel_mode: bool, ?
|
|
422
|
-
|
|
423
|
-
# Modifies an existing XLSX file in-memory using an immutable transformation block.
|
|
424
|
-
#
|
|
425
|
-
# Reads the workbook, passes it to the block, and writes the resulting workbook.
|
|
426
|
-
# If no target is specified, the source file is overwritten in-place.
|
|
427
|
-
#
|
|
428
|
-
# @example Modify a template and save to new file
|
|
429
|
-
# Xlsxrb.modify("template.xlsx", "output.xlsx") do |workbook|
|
|
430
|
-
# workbook.update_sheet("Sheet1") do |sheet|
|
|
431
|
-
# sheet.update_cell("B1", value: "Updated Title")
|
|
432
|
-
# .update_cell("B2", value: 100)
|
|
433
|
-
# end
|
|
434
|
-
# end
|
|
435
|
-
#
|
|
436
|
-
# @param source [String, IO, StringIO] The source file path or IO object.
|
|
437
|
-
# @param target [String, IO, StringIO, nil] Target file path or IO object (overwrites source if nil).
|
|
438
|
-
# @param password [String, nil] Optional password for encrypted files.
|
|
439
|
-
# @yield [workbook]
|
|
440
|
-
# @yieldparam workbook [Elements::Workbook] The loaded workbook.
|
|
441
|
-
# @yieldreturn [Elements::Workbook] The modified workbook.
|
|
442
|
-
# @return [void]
|
|
443
|
-
# @api public
|
|
444
|
-
# : (untyped source, ?untyped target, ?password: String?) ?{ (Elements::Workbook) -> untyped } -> void
|
|
445
|
-
def self.modify: (untyped source, ?untyped target, ?password: String?) ?{ (Elements::Workbook) -> untyped } -> void
|
|
514
|
+
# @param compression_level [Integer, nil] ZIP deflate compression level (0..9, or Zlib::DEFAULT_COMPRESSION
|
|
515
|
+
# for zlib's level 6). Defaults to {DEFAULT_COMPRESSION_LEVEL}. Higher levels write smaller files more slowly;
|
|
516
|
+
# level 0 stores entries without compression. See docs/adr/0009-default-zip-compression-level.md.
|
|
517
|
+
# : (?untyped target_or_workbook, ?Elements::Workbook | untyped workbook_or_nil, ?password: String?, ?encryption_mode: Symbol, ?strict_excel_mode: bool, ?default_font: untyped?, ?shared_strings: bool, ?compression_level: Integer | nil) ?{ (StreamWriter) -> void } -> untyped
|
|
518
|
+
def self.write: (?untyped target_or_workbook, ?Elements::Workbook | untyped workbook_or_nil, ?password: String?, ?encryption_mode: Symbol, ?strict_excel_mode: bool, ?default_font: untyped?, ?shared_strings: bool, ?compression_level: Integer | nil) ?{ (StreamWriter) -> void } -> untyped
|
|
446
519
|
|
|
447
520
|
# Builds an in-memory {Elements::Workbook} using a declarative DSL.
|
|
448
521
|
#
|
|
@@ -455,6 +528,7 @@ module Xlsxrb
|
|
|
455
528
|
# end
|
|
456
529
|
#
|
|
457
530
|
# @param strict_excel_mode [Boolean] Whether to enforce Microsoft Excel specification limits.
|
|
531
|
+
# @param default_font [Hash, nil] Optional default font options.
|
|
458
532
|
# @yield [builder]
|
|
459
533
|
# @yieldparam builder [Xlsxrb::WorkbookBuilder]
|
|
460
534
|
# @return [Elements::Workbook] The compiled in-memory workbook.
|
|
@@ -474,8 +548,8 @@ module Xlsxrb
|
|
|
474
548
|
|
|
475
549
|
private def self.resolve_part_entry: (untyped zip_reader, untyped rels, untyped rel_type_sub, untyped fallback_name, untyped wb_dir) -> untyped
|
|
476
550
|
|
|
477
|
-
# : (String name, String? sheet_xml, Array[String] shared_strings, untyped styles, ?state: Symbol, ?zip_reader: Ooxml::ZipReader?, ?entry_name: String?, ?hyperlinks: Hash[String, untyped]?, ?comments: Array[Hash[Symbol, untyped]]?, ?images: Array[Elements::Image]?, ?date1904: bool, ?dimension: String?, ?trim_empty_rows: bool, ?pad_empty_rows: bool, ?pad_empty_cells: bool, ?merged_cells: Array[String]?, ?auto_filter: String?, ?tables: Array[Hash[Symbol, untyped]]?, ?shapes: Array[Hash[Symbol, untyped]]?, ?freeze_pane: Hash[Symbol, untyped]?, ?page_setup: Hash[Symbol, untyped]?, ?page_margins: Hash[Symbol, untyped]?, ?header_footer: Hash[Symbol, untyped]?, ?print_options: Hash[Symbol, untyped]?, ?sheet_protection: Hash[Symbol, untyped]?, ?sheet_view: Hash[Symbol, untyped]?, ?sheet_properties: Hash[Symbol, untyped]?, ?sheet_format: Hash[Symbol, untyped]?, ?row_breaks: Array[untyped]?, ?col_breaks: Array[untyped]?, ?protected_ranges: Array[Hash[Symbol, untyped]]?, ?cell_watches: Array[String]?, ?ignored_errors: Array[Hash[Symbol, untyped]]?, ?phonetic_properties: Hash[Symbol, untyped]?, ?selection: (Hash[Symbol, untyped] | Array[Hash[Symbol, untyped]])?, ?
|
|
478
|
-
private def self.build_worksheet: (String name, String? sheet_xml, Array[String] shared_strings, untyped styles, ?state: Symbol, ?zip_reader: Ooxml::ZipReader?, ?entry_name: String?, ?hyperlinks: Hash[String, untyped]?, ?comments: Array[Hash[Symbol, untyped]]?, ?images: Array[Elements::Image]?, ?date1904: bool, ?dimension: String?, ?trim_empty_rows: bool, ?pad_empty_rows: bool, ?pad_empty_cells: bool, ?merged_cells: Array[String]?, ?auto_filter: String?, ?tables: Array[Hash[Symbol, untyped]]?, ?shapes: Array[Hash[Symbol, untyped]]?, ?freeze_pane: Hash[Symbol, untyped]?, ?page_setup: Hash[Symbol, untyped]?, ?page_margins: Hash[Symbol, untyped]?, ?header_footer: Hash[Symbol, untyped]?, ?print_options: Hash[Symbol, untyped]?, ?sheet_protection: Hash[Symbol, untyped]?, ?sheet_view: Hash[Symbol, untyped]?, ?sheet_properties: Hash[Symbol, untyped]?, ?sheet_format: Hash[Symbol, untyped]?, ?row_breaks: Array[untyped]?, ?col_breaks: Array[untyped]?, ?protected_ranges: Array[Hash[Symbol, untyped]]?, ?cell_watches: Array[String]?, ?ignored_errors: Array[Hash[Symbol, untyped]]?, ?phonetic_properties: Hash[Symbol, untyped]?, ?selection: (Hash[Symbol, untyped] | Array[Hash[Symbol, untyped]])?, ?
|
|
551
|
+
# : (String name, String? sheet_xml, Array[String] shared_strings, untyped styles, ?state: Symbol, ?zip_reader: Ooxml::ZipReader?, ?entry_name: String?, ?hyperlinks: Hash[String, untyped]?, ?comments: Array[Hash[Symbol, untyped]]?, ?images: Array[Elements::Image]?, ?date1904: bool, ?dimension: String?, ?trim_empty_rows: bool, ?pad_empty_rows: bool, ?pad_empty_cells: bool, ?merged_cells: Array[String]?, ?auto_filter: String?, ?tables: Array[Hash[Symbol, untyped]]?, ?shapes: Array[Hash[Symbol, untyped]]?, ?freeze_pane: Hash[Symbol, untyped]?, ?page_setup: Hash[Symbol, untyped]?, ?page_margins: Hash[Symbol, untyped]?, ?header_footer: Hash[Symbol, untyped]?, ?print_options: Hash[Symbol, untyped]?, ?sheet_protection: Hash[Symbol, untyped]?, ?sheet_view: Hash[Symbol, untyped]?, ?sheet_properties: Hash[Symbol, untyped]?, ?sheet_format: Hash[Symbol, untyped]?, ?row_breaks: Array[untyped]?, ?column_breaks: Array[untyped]?, ?col_breaks: Array[untyped]?, ?protected_ranges: Array[Hash[Symbol, untyped]]?, ?cell_watches: Array[String]?, ?ignored_errors: Array[Hash[Symbol, untyped]]?, ?phonetic_properties: Hash[Symbol, untyped]?, ?selection: (Hash[Symbol, untyped] | Array[Hash[Symbol, untyped]])?, ?sheet_calc_properties: Hash[Symbol, untyped]?, ?background_image: Hash[Symbol, untyped]?, ?threaded_comments: Array[Hash[Symbol, untyped]]?, ?columns: Array[Elements::Column]?, ?pivot_tables: Array[Hash[Symbol, untyped]]?, ?split_pane: Hash[Symbol, untyped]?, ?filter_columns: Hash[Integer, Hash[Symbol, untyped]]?, ?sort_state: Hash[Symbol, untyped]?, ?header_footer_images: (Array[Elements::HeaderFooterImage] | Array[Hash[Symbol, untyped]])?, ?charts: (Array[Elements::Chart] | Array[Hash[Symbol, untyped]])?, ?sparkline_groups: (Array[Elements::SparklineGroup] | Array[Hash[Symbol, untyped]])?, ?print_area: String?, ?print_titles: (Elements::PrintTitles | Hash[Symbol, untyped])?) -> Elements::Worksheet
|
|
552
|
+
private def self.build_worksheet: (String name, String? sheet_xml, Array[String] shared_strings, untyped styles, ?state: Symbol, ?zip_reader: Ooxml::ZipReader?, ?entry_name: String?, ?hyperlinks: Hash[String, untyped]?, ?comments: Array[Hash[Symbol, untyped]]?, ?images: Array[Elements::Image]?, ?date1904: bool, ?dimension: String?, ?trim_empty_rows: bool, ?pad_empty_rows: bool, ?pad_empty_cells: bool, ?merged_cells: Array[String]?, ?auto_filter: String?, ?tables: Array[Hash[Symbol, untyped]]?, ?shapes: Array[Hash[Symbol, untyped]]?, ?freeze_pane: Hash[Symbol, untyped]?, ?page_setup: Hash[Symbol, untyped]?, ?page_margins: Hash[Symbol, untyped]?, ?header_footer: Hash[Symbol, untyped]?, ?print_options: Hash[Symbol, untyped]?, ?sheet_protection: Hash[Symbol, untyped]?, ?sheet_view: Hash[Symbol, untyped]?, ?sheet_properties: Hash[Symbol, untyped]?, ?sheet_format: Hash[Symbol, untyped]?, ?row_breaks: Array[untyped]?, ?column_breaks: Array[untyped]?, ?col_breaks: Array[untyped]?, ?protected_ranges: Array[Hash[Symbol, untyped]]?, ?cell_watches: Array[String]?, ?ignored_errors: Array[Hash[Symbol, untyped]]?, ?phonetic_properties: Hash[Symbol, untyped]?, ?selection: (Hash[Symbol, untyped] | Array[Hash[Symbol, untyped]])?, ?sheet_calc_properties: Hash[Symbol, untyped]?, ?background_image: Hash[Symbol, untyped]?, ?threaded_comments: Array[Hash[Symbol, untyped]]?, ?columns: Array[Elements::Column]?, ?pivot_tables: Array[Hash[Symbol, untyped]]?, ?split_pane: Hash[Symbol, untyped]?, ?filter_columns: Hash[Integer, Hash[Symbol, untyped]]?, ?sort_state: Hash[Symbol, untyped]?, ?header_footer_images: (Array[Elements::HeaderFooterImage] | Array[Hash[Symbol, untyped]])?, ?charts: (Array[Elements::Chart] | Array[Hash[Symbol, untyped]])?, ?sparkline_groups: (Array[Elements::SparklineGroup] | Array[Hash[Symbol, untyped]])?, ?print_area: String?, ?print_titles: (Elements::PrintTitles | Hash[Symbol, untyped])?) -> Elements::Worksheet
|
|
479
553
|
|
|
480
554
|
# : (String? sheet_xml, ?zip_reader: Ooxml::ZipReader?, ?entry_name: String?, ?rels_xml: String?) -> Hash[String, Hash[Symbol, untyped]]
|
|
481
555
|
private def self.resolve_hyperlinks: (String? sheet_xml, ?zip_reader: Ooxml::ZipReader?, ?entry_name: String?, ?rels_xml: String?) -> Hash[String, Hash[Symbol, untyped]]
|
|
@@ -486,6 +560,11 @@ module Xlsxrb
|
|
|
486
560
|
# : (?zip_reader: Ooxml::ZipReader?, ?entry_name: String?) -> Array[Hash[Symbol, untyped]]
|
|
487
561
|
private def self.resolve_comments: (?zip_reader: Ooxml::ZipReader?, ?entry_name: String?) -> Array[Hash[Symbol, untyped]]
|
|
488
562
|
|
|
563
|
+
# Reads the comment notes of the sheet's legacy VML drawing, keyed by cell reference:
|
|
564
|
+
# whether each is shown permanently (<x:Visible/>) and its <x:Anchor> box position.
|
|
565
|
+
# : (Ooxml::ZipReader zip_reader, Array[Hash[Symbol, untyped]] relationships, String base_dir) -> Hash[String, Hash[Symbol, untyped]]
|
|
566
|
+
private def self.vml_notes: (Ooxml::ZipReader zip_reader, Array[Hash[Symbol, untyped]] relationships, String base_dir) -> Hash[String, Hash[Symbol, untyped]]
|
|
567
|
+
|
|
489
568
|
# : (?zip_reader: Ooxml::ZipReader?, ?entry_name: String?) -> Array[Hash[Symbol, untyped]]
|
|
490
569
|
private def self.resolve_threaded_comments: (?zip_reader: Ooxml::ZipReader?, ?entry_name: String?) -> Array[Hash[Symbol, untyped]]
|
|
491
570
|
|
|
@@ -504,48 +583,30 @@ module Xlsxrb
|
|
|
504
583
|
# : (?zip_reader: Ooxml::ZipReader?, ?entry_name: String?) -> Array[Hash[Symbol, untyped]]
|
|
505
584
|
private def self.resolve_shapes: (?zip_reader: Ooxml::ZipReader?, ?entry_name: String?) -> Array[Hash[Symbol, untyped]]
|
|
506
585
|
|
|
507
|
-
# : (
|
|
508
|
-
private def self.
|
|
509
|
-
|
|
510
|
-
# : (Elements::Cell cell, Array[String] sst, Hash[String, Integer] sst_index, ?date1904: bool) -> Hash[Symbol, untyped]
|
|
511
|
-
private def self.build_raw_cell: (Elements::Cell cell, Array[String] sst, Hash[String, Integer] sst_index, ?date1904: bool) -> Hash[Symbol, untyped]
|
|
512
|
-
|
|
513
|
-
# : (Elements::Row row) -> Hash[Symbol, untyped]
|
|
514
|
-
private def self.build_row_attrs: (Elements::Row row) -> Hash[Symbol, untyped]
|
|
515
|
-
|
|
516
|
-
# : (untyped source, String? password) -> untyped
|
|
517
|
-
private def self.prepare_source_io: (untyped source, String? password) -> untyped
|
|
586
|
+
# : (?zip_reader: Ooxml::ZipReader?, ?entry_name: String?) -> Array[Hash[Symbol, untyped]]
|
|
587
|
+
private def self.resolve_pivot_tables: (?zip_reader: Ooxml::ZipReader?, ?entry_name: String?) -> Array[Hash[Symbol, untyped]]
|
|
518
588
|
|
|
519
|
-
# : (
|
|
520
|
-
private def self.
|
|
589
|
+
# : (?zip_reader: Ooxml::ZipReader?, ?entry_name: String?) -> Array[Elements::Chart]
|
|
590
|
+
private def self.resolve_charts: (?zip_reader: Ooxml::ZipReader?, ?entry_name: String?) -> Array[Elements::Chart]
|
|
521
591
|
|
|
522
|
-
# : (String
|
|
523
|
-
private def self.
|
|
592
|
+
# : (String? sheet_xml) -> Array[Elements::SparklineGroup]
|
|
593
|
+
private def self.resolve_sparkline_groups: (String? sheet_xml) -> Array[Elements::SparklineGroup]
|
|
524
594
|
|
|
525
|
-
# : (String sheet_xml, String
|
|
526
|
-
private def self.
|
|
595
|
+
# : (String? sheet_xml, ?zip_reader: Ooxml::ZipReader?, ?entry_name: String?) -> Array[Elements::HeaderFooterImage]
|
|
596
|
+
private def self.resolve_header_footer_images: (String? sheet_xml, ?zip_reader: Ooxml::ZipReader?, ?entry_name: String?) -> Array[Elements::HeaderFooterImage]
|
|
527
597
|
|
|
528
|
-
# : (String
|
|
529
|
-
private def self.
|
|
598
|
+
# : (Array[untyped]? defined_names, String? sheet_name, Integer? sheet_index) -> String?
|
|
599
|
+
private def self.extract_sheet_print_area: (Array[untyped]? defined_names, String? sheet_name, Integer? sheet_index) -> String?
|
|
530
600
|
|
|
531
|
-
# : (
|
|
532
|
-
private def self.
|
|
601
|
+
# : (Array[untyped]? defined_names, String? sheet_name, Integer? sheet_index) -> Elements::PrintTitles?
|
|
602
|
+
private def self.extract_sheet_print_titles: (Array[untyped]? defined_names, String? sheet_name, Integer? sheet_index) -> Elements::PrintTitles?
|
|
533
603
|
|
|
534
|
-
# : (
|
|
535
|
-
private def self.
|
|
604
|
+
# : (untyped defined_name, String? sheet_name, Integer? sheet_index) -> bool
|
|
605
|
+
private def self.match_sheet_defined_name?: (untyped defined_name, String? sheet_name, Integer? sheet_index) -> bool
|
|
536
606
|
|
|
537
|
-
# : (
|
|
538
|
-
private def self.
|
|
607
|
+
# : (untyped raw_row, ?Hash[String, untyped] hyperlinks, ?(Array[untyped] | Hash[String, untyped]) comments, ?Hash[untyped, untyped]? styles, ?date1904: bool, ?threaded_comments: (Array[untyped] | Hash[String, untyped])) -> (Elements::Row | untyped)
|
|
608
|
+
private def self.build_row_from_raw: (untyped raw_row, ?Hash[String, untyped] hyperlinks, ?Array[untyped] | Hash[String, untyped] comments, ?Hash[untyped, untyped]? styles, ?date1904: bool, ?threaded_comments: Array[untyped] | Hash[String, untyped]) -> (Elements::Row | untyped)
|
|
539
609
|
|
|
540
|
-
#
|
|
541
|
-
|
|
542
|
-
# @param row_index [Integer] 0-based row index.
|
|
543
|
-
# @param col_index [Integer] 0-based column index.
|
|
544
|
-
# @param value [Object] Cell value.
|
|
545
|
-
# @param sst [Array<String>] Shared strings array.
|
|
546
|
-
# @param sst_index [Hash{String => Integer}] Shared strings index mapping.
|
|
547
|
-
# @return [Hash{Symbol => Object}] Raw cell hash.
|
|
548
|
-
# @api public
|
|
549
|
-
# : (Integer row_index, Integer col_index, untyped value, Array[String] sst, Hash[String, Integer] sst_index, ?date1904: bool) -> Hash[Symbol, untyped]
|
|
550
|
-
def self.build_raw_cell_from_value: (Integer row_index, Integer col_index, untyped value, Array[String] sst, Hash[String, Integer] sst_index, ?date1904: bool) -> Hash[Symbol, untyped]
|
|
610
|
+
# : (untyped source, String? password) -> untyped
|
|
611
|
+
private def self.prepare_source_io: (untyped source, String? password) -> untyped
|
|
551
612
|
end
|
data/sig/rexml.rbs
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: xlsxrb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- niku
|
|
@@ -61,6 +61,7 @@ files:
|
|
|
61
61
|
- lib/xlsxrb/elements/column.rb
|
|
62
62
|
- lib/xlsxrb/elements/coordinate_access.rb
|
|
63
63
|
- lib/xlsxrb/elements/image.rb
|
|
64
|
+
- lib/xlsxrb/elements/metadata.rb
|
|
64
65
|
- lib/xlsxrb/elements/row.rb
|
|
65
66
|
- lib/xlsxrb/elements/styles.rb
|
|
66
67
|
- lib/xlsxrb/elements/types.rb
|
|
@@ -98,7 +99,6 @@ files:
|
|
|
98
99
|
- lib/xlsxrb/stream_sheet.rb
|
|
99
100
|
- lib/xlsxrb/stream_writer.rb
|
|
100
101
|
- lib/xlsxrb/style_builder.rb
|
|
101
|
-
- lib/xlsxrb/utils.rb
|
|
102
102
|
- lib/xlsxrb/version.rb
|
|
103
103
|
- lib/xlsxrb/workbook_builder.rb
|
|
104
104
|
- lib/xlsxrb/worksheet_builder.rb
|
|
@@ -111,6 +111,7 @@ files:
|
|
|
111
111
|
- sig/generated/xlsxrb/elements/column.rbs
|
|
112
112
|
- sig/generated/xlsxrb/elements/coordinate_access.rbs
|
|
113
113
|
- sig/generated/xlsxrb/elements/image.rbs
|
|
114
|
+
- sig/generated/xlsxrb/elements/metadata.rbs
|
|
114
115
|
- sig/generated/xlsxrb/elements/row.rbs
|
|
115
116
|
- sig/generated/xlsxrb/elements/styles.rbs
|
|
116
117
|
- sig/generated/xlsxrb/elements/types.rbs
|
|
@@ -148,7 +149,6 @@ files:
|
|
|
148
149
|
- sig/generated/xlsxrb/stream_sheet.rbs
|
|
149
150
|
- sig/generated/xlsxrb/stream_writer.rbs
|
|
150
151
|
- sig/generated/xlsxrb/style_builder.rbs
|
|
151
|
-
- sig/generated/xlsxrb/utils.rbs
|
|
152
152
|
- sig/generated/xlsxrb/version.rbs
|
|
153
153
|
- sig/generated/xlsxrb/workbook_builder.rbs
|
|
154
154
|
- sig/generated/xlsxrb/worksheet_builder.rbs
|
|
@@ -169,14 +169,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
169
169
|
requirements:
|
|
170
170
|
- - ">="
|
|
171
171
|
- !ruby/object:Gem::Version
|
|
172
|
-
version: 4.0
|
|
172
|
+
version: 3.4.0
|
|
173
173
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
174
174
|
requirements:
|
|
175
175
|
- - ">="
|
|
176
176
|
- !ruby/object:Gem::Version
|
|
177
177
|
version: '0'
|
|
178
178
|
requirements: []
|
|
179
|
-
rubygems_version: 4.0.
|
|
179
|
+
rubygems_version: 4.0.20
|
|
180
180
|
specification_version: 4
|
|
181
181
|
summary: A streaming-capable, fast, low-memory XLSX reader/writer.
|
|
182
182
|
test_files: []
|