caxlsx_builder 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/caxlsx_builder/builder.rb +9 -5
- data/lib/caxlsx_builder/sheet.rb +6 -4
- data/lib/caxlsx_builder/version.rb +1 -1
- data/sig/caxlsx_builder/builder.rbs +2 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 99c1449eab24e473b70cfb60c6fb9ffb8750bcfd3331bd4e1bc4d11fa172c5ea
|
4
|
+
data.tar.gz: d5a2146247674eb9bd7abb422a0e5635997759ec205619e1518a6e322af1c535
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6018bbabd3db00124d3657aee635c6c082c313d321c38345b6322e9ebad534318b73331f897508b1b2863a9933e50ae3b70d1cc2ef0f83783815411f1502c1c3
|
7
|
+
data.tar.gz: 0fe4e1c53f7d85a28cb00e7804f77310971d8fae32994a84a590de651283d20f45b32601bb11be2ef252c930fe55cbfef5945582ef995f4c5519295cf9e8d48b
|
data/CHANGELOG.md
CHANGED
@@ -125,20 +125,24 @@ module CaxlsxBuilder
|
|
125
125
|
|
126
126
|
footer = sheet.footers.map.with_index do |cell, index|
|
127
127
|
if cell.respond_to?(:call)
|
128
|
-
cell
|
128
|
+
call_footer_proc(cell, sheet.cells(index))
|
129
129
|
else
|
130
130
|
cell
|
131
131
|
end
|
132
|
-
rescue StandardError => e
|
133
|
-
return nil if @options[:rescue_errors]
|
134
|
-
|
135
|
-
raise e
|
136
132
|
end
|
137
133
|
|
138
134
|
# Last row is the footer with the footer style applied
|
139
135
|
worksheet.add_row(footer, style: @styles[:footer])
|
140
136
|
end
|
141
137
|
|
138
|
+
def call_footer_proc(cell, cells)
|
139
|
+
cell.call(cells)
|
140
|
+
rescue StandardError => e
|
141
|
+
return nil if @options[:rescue_errors]
|
142
|
+
|
143
|
+
raise e
|
144
|
+
end
|
145
|
+
|
142
146
|
# @return [Hash] The options to apply to a cell
|
143
147
|
def cell_options(style: nil, type: nil)
|
144
148
|
style = get_style(style)
|
data/lib/caxlsx_builder/sheet.rb
CHANGED
@@ -28,11 +28,13 @@ module CaxlsxBuilder
|
|
28
28
|
def make_row(item, rescue_errors: false)
|
29
29
|
# Build the new row
|
30
30
|
row = @cell_builders.map do |cell|
|
31
|
-
|
32
|
-
|
33
|
-
|
31
|
+
begin
|
32
|
+
cell.call(item)
|
33
|
+
rescue StandardError => e
|
34
|
+
next nil if rescue_errors
|
34
35
|
|
35
|
-
|
36
|
+
raise e
|
37
|
+
end
|
36
38
|
end
|
37
39
|
|
38
40
|
# Add the new row to the cache then return it
|
@@ -34,6 +34,8 @@ module CaxlsxBuilder
|
|
34
34
|
|
35
35
|
def add_footer_row: (Sheet sheet, Axlsx::Worksheet worksheet) -> void
|
36
36
|
|
37
|
+
def call_footer_proc: (Sheet::footer_proc cell, Array[Sheet::cell_value]? cells) -> Sheet::cell_value?
|
38
|
+
|
37
39
|
def cell_options: (style: String? | Symbol?, type: Cell::type_value?) -> { style: Integer, type: Cell::type_value }
|
38
40
|
|
39
41
|
def cast_to_hash: (Array[{ style: Integer, type: Cell::type_value }] | { style: Array[Integer], types: Array[Cell::type_value] }) -> { style: Array[Integer], types: Array[Cell::type_value] }
|