caxlsx 4.2.0 → 4.3.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 +7 -0
- data/README.md +6 -0
- data/Rakefile +2 -9
- data/lib/axlsx/drawing/bar_3D_chart.rb +11 -1
- data/lib/axlsx/drawing/bar_chart.rb +11 -1
- data/lib/axlsx/drawing/chart.rb +1 -0
- data/lib/axlsx/drawing/d_lbls.rb +1 -0
- data/lib/axlsx/drawing/vml_shape.rb +1 -1
- data/lib/axlsx/package.rb +3 -2
- data/lib/axlsx/stylesheet/border_pr.rb +1 -0
- data/lib/axlsx/stylesheet/pattern_fill.rb +1 -0
- data/lib/axlsx/stylesheet/xf.rb +1 -0
- data/lib/axlsx/util/buffered_zip_output_stream.rb +2 -2
- data/lib/axlsx/util/simple_typed_list.rb +1 -2
- data/lib/axlsx/util/validators.rb +1 -1
- data/lib/axlsx/version.rb +1 -1
- data/lib/axlsx/workbook/defined_name.rb +1 -0
- data/lib/axlsx/workbook/worksheet/auto_filter/filters.rb +1 -1
- data/lib/axlsx/workbook/worksheet/cell.rb +3 -3
- data/lib/axlsx/workbook/worksheet/col.rb +1 -0
- data/lib/axlsx/workbook/worksheet/header_footer.rb +1 -1
- data/lib/axlsx/workbook/worksheet/pane.rb +1 -0
- data/lib/axlsx/workbook/worksheet/pivot_table.rb +1 -1
- data/lib/axlsx/workbook/worksheet/print_options.rb +1 -0
- data/lib/axlsx/workbook/worksheet/sheet_calc_pr.rb +1 -0
- data/lib/axlsx/workbook/worksheet/table_style_info.rb +1 -0
- data/lib/axlsx/workbook/worksheet/worksheet_comments.rb +1 -1
- data/lib/axlsx/workbook/worksheet/worksheet_drawing.rb +1 -1
- data/lib/axlsx/workbook/worksheet/worksheet_hyperlink.rb +1 -0
- metadata +7 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0f9a2b86a38ca45670bc0e74443d58a8d56b89a5d3d4891641bf6168fbcba02
|
4
|
+
data.tar.gz: b8f16b2ae2e718fb07c763c4085da9acbc3982ab63bffcee3de5a9b5741e504c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2830801b587922e0e765d147e7eaa01d33527d82efc3950d4241889e828fabf814270c64d0f18c4dd91880eaa848cff3a7c4b7c3f4f38e1ba95ef004900208b
|
7
|
+
data.tar.gz: f08afe03aedf885c94f035b69302bcd55a024efe4801c056a9383b47b2f5052d7fb4259b74bda32e82ecb6d2ece041e89573a26c233330991467d66344fc7689
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,13 @@ CHANGELOG
|
|
2
2
|
---------
|
3
3
|
- **Unreleased**
|
4
4
|
|
5
|
+
|
6
|
+
- **August.16.25**: 4.3.0
|
7
|
+
- [PR #421](https://github.com/caxlsx/caxlsx/pull/421) Add Rubyzip >= 2.4 support
|
8
|
+
- [PR #448](https://github.com/caxlsx/caxlsx/pull/448) Fix Bar Chart: set axis position for Apple Numbers compatibility
|
9
|
+
- [PR #466](https://github.com/caxlsx/caxlsx/pull/466) Use RubyGem's trusted publishing
|
10
|
+
- [PR #467](https://github.com/caxlsx/caxlsx/pull/467) Add JRuby 10.0 to the CI
|
11
|
+
|
5
12
|
- **December.15.24**: 4.2.0
|
6
13
|
- [PR #359](https://github.com/caxlsx/caxlsx/pull/359) Add `PivotTable#grand_totals` option to remove grand totals row/col
|
7
14
|
- [PR #362](https://github.com/caxlsx/caxlsx/pull/362) Use widest width even if provided as fixed value
|
data/README.md
CHANGED
@@ -107,6 +107,12 @@ Additional documentation is listed below:
|
|
107
107
|
- [Style Reference](https://github.com/caxlsx/caxlsx/blob/master/docs/style_reference.md)
|
108
108
|
- [Header and Footer Codes](https://github.com/caxlsx/caxlsx/blob/master/docs/header_and_footer_codes.md)
|
109
109
|
|
110
|
+
You can run the documentation on your local by running the following:
|
111
|
+
```sh
|
112
|
+
gem install webrick
|
113
|
+
yard server
|
114
|
+
```
|
115
|
+
|
110
116
|
⚠ Please __do not create issues__ for questions regarding the usage of axlsx / caxlsx. Look through this README, the [examples folder](https://github.com/caxlsx/caxlsx/tree/master/examples), and the [FAQ](https://github.com/caxlsx/caxlsx/wiki/FAQ), and also check [questions tagged `axlsx` on Stack Overflow](https://stackoverflow.com/questions/tagged/axlsx).
|
111
117
|
|
112
118
|
Feel free to add your question (including an answer!) to the FAQ if you think it is of general interest.
|
data/Rakefile
CHANGED
@@ -1,10 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
|
5
|
-
task build: :gendoc do
|
6
|
-
system "gem build axlsx.gemspec"
|
7
|
-
end
|
3
|
+
require 'bundler'
|
4
|
+
Bundler::GemHelper.install_tasks
|
8
5
|
|
9
6
|
task :benchmark do
|
10
7
|
require File.expand_path("#{File.dirname(__FILE__)}/test/benchmark.rb")
|
@@ -23,8 +20,4 @@ Rake::TestTask.new do |t|
|
|
23
20
|
t.warning = true
|
24
21
|
end
|
25
22
|
|
26
|
-
task release: :build do
|
27
|
-
system "gem push caxlsx-#{Axlsx::VERSION}.gem"
|
28
|
-
end
|
29
|
-
|
30
23
|
task default: :test
|
@@ -141,7 +141,17 @@ module Axlsx
|
|
141
141
|
# category axes specified via axes[:val_axes] and axes[:cat_axis]
|
142
142
|
# @return [Axes]
|
143
143
|
def axes
|
144
|
-
@axes ||=
|
144
|
+
@axes ||= begin
|
145
|
+
a = Axes.new(cat_axis: CatAxis, val_axis: ValAxis)
|
146
|
+
|
147
|
+
if bar_dir == :col
|
148
|
+
a[:val_axis].ax_pos = :l
|
149
|
+
else
|
150
|
+
a[:cat_axis].ax_pos = :l
|
151
|
+
end
|
152
|
+
|
153
|
+
a
|
154
|
+
end
|
145
155
|
end
|
146
156
|
end
|
147
157
|
end
|
@@ -131,7 +131,17 @@ module Axlsx
|
|
131
131
|
# category axes specified via axes[:val_axes] and axes[:cat_axis]
|
132
132
|
# @return [Axes]
|
133
133
|
def axes
|
134
|
-
@axes ||=
|
134
|
+
@axes ||= begin
|
135
|
+
a = Axes.new(cat_axis: CatAxis, val_axis: ValAxis)
|
136
|
+
|
137
|
+
if bar_dir == :col
|
138
|
+
a[:val_axis].ax_pos = :l
|
139
|
+
else
|
140
|
+
a[:cat_axis].ax_pos = :l
|
141
|
+
end
|
142
|
+
|
143
|
+
a
|
144
|
+
end
|
135
145
|
end
|
136
146
|
end
|
137
147
|
end
|
data/lib/axlsx/drawing/chart.rb
CHANGED
data/lib/axlsx/drawing/d_lbls.rb
CHANGED
@@ -9,6 +9,7 @@ module Axlsx
|
|
9
9
|
class DLbls
|
10
10
|
include Axlsx::Accessors
|
11
11
|
include Axlsx::OptionsParser
|
12
|
+
|
12
13
|
# creates a new DLbls object
|
13
14
|
def initialize(chart_type, options = {})
|
14
15
|
raise ArgumentError, 'chart_type must inherit from Chart' unless [Chart, LineChart].include?(chart_type.superclass)
|
data/lib/axlsx/package.rb
CHANGED
@@ -147,7 +147,7 @@ module Axlsx
|
|
147
147
|
|
148
148
|
# Encrypt the package into a CFB using the password provided
|
149
149
|
# This is not ready yet
|
150
|
-
def encrypt(file_name, password)
|
150
|
+
def encrypt(file_name, password) # rubocop:disable Naming/PredicateMethod
|
151
151
|
false
|
152
152
|
# moc = MsOffCrypto.new(file_name, password)
|
153
153
|
# moc.save
|
@@ -211,7 +211,8 @@ module Axlsx
|
|
211
211
|
# @return [Zip::Entry]
|
212
212
|
def zip_entry_for_part(part)
|
213
213
|
timestamp = Zip::DOSTime.at(@core.created.to_i)
|
214
|
-
|
214
|
+
|
215
|
+
Zip::Entry.new("", part[:entry], time: timestamp)
|
215
216
|
end
|
216
217
|
|
217
218
|
# The parts of a package
|
data/lib/axlsx/stylesheet/xf.rb
CHANGED
@@ -19,7 +19,7 @@ module Axlsx
|
|
19
19
|
#
|
20
20
|
# The directory and its contents are removed at the end of the block.
|
21
21
|
def self.open(file_name, encrypter = nil)
|
22
|
-
Zip::OutputStream.open(file_name, encrypter) do |zos|
|
22
|
+
Zip::OutputStream.open(file_name, encrypter: encrypter) do |zos|
|
23
23
|
bzos = new(zos)
|
24
24
|
yield(bzos)
|
25
25
|
ensure
|
@@ -28,7 +28,7 @@ module Axlsx
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def self.write_buffer(io = ::StringIO.new, encrypter = nil)
|
31
|
-
Zip::OutputStream.write_buffer(io, encrypter) do |zos|
|
31
|
+
Zip::OutputStream.write_buffer(io, encrypter: encrypter) do |zos|
|
32
32
|
bzos = new(zos)
|
33
33
|
yield(bzos)
|
34
34
|
ensure
|
@@ -183,8 +183,7 @@ module Axlsx
|
|
183
183
|
end
|
184
184
|
|
185
185
|
def to_xml_string(str = +'')
|
186
|
-
|
187
|
-
el_name = serialize_as.to_s || (classname[0, 1].downcase + classname[1..])
|
186
|
+
el_name = serialize_as.to_s
|
188
187
|
str << '<' << el_name << ' count="' << size.to_s << '">'
|
189
188
|
each { |item| item.to_xml_string(str) }
|
190
189
|
str << '</' << el_name << '>'
|
@@ -9,7 +9,7 @@ module Axlsx
|
|
9
9
|
# @param [Any] v The value to be validated
|
10
10
|
# @raise [ArgumentError] Raised if the value provided is not in the list of choices.
|
11
11
|
# @return [Boolean] true if validation succeeds.
|
12
|
-
def self.validate(name, choices, v)
|
12
|
+
def self.validate(name, choices, v) # rubocop:disable Naming/PredicateMethod
|
13
13
|
raise ArgumentError, format(ERR_RESTRICTION, v.to_s, name, choices.inspect) unless choices.include?(v)
|
14
14
|
|
15
15
|
true
|
data/lib/axlsx/version.rb
CHANGED
@@ -54,6 +54,7 @@ module Axlsx
|
|
54
54
|
include Axlsx::SerializedAttributes
|
55
55
|
include Axlsx::OptionsParser
|
56
56
|
include Axlsx::Accessors
|
57
|
+
|
57
58
|
# creates a new DefinedName.
|
58
59
|
# @param [String] formula - the formula the defined name references
|
59
60
|
# @param [Hash] options - A hash of key/value pairs that will be mapped to this instances attributes.
|
@@ -41,7 +41,7 @@ module Axlsx
|
|
41
41
|
# date_group_items restrictions.
|
42
42
|
# @param [Cell] cell The cell to test against items
|
43
43
|
# TODO implement this for date filters as well!
|
44
|
-
def apply(cell)
|
44
|
+
def apply(cell) # rubocop:disable Naming/PredicateMethod
|
45
45
|
return false unless cell
|
46
46
|
|
47
47
|
filter_items.each do |filter|
|
@@ -166,7 +166,7 @@ module Axlsx
|
|
166
166
|
|
167
167
|
# Indicates that the cell has one or more of the custom cell styles applied.
|
168
168
|
# @return [Boolean]
|
169
|
-
def is_text_run? # rubocop:disable Naming/
|
169
|
+
def is_text_run? # rubocop:disable Naming/PredicatePrefix
|
170
170
|
defined?(@is_text_run) && @is_text_run && !contains_rich_text?
|
171
171
|
end
|
172
172
|
|
@@ -410,13 +410,13 @@ module Axlsx
|
|
410
410
|
CellSerializer.to_xml_string r_index, c_index, self, str
|
411
411
|
end
|
412
412
|
|
413
|
-
def is_formula? # rubocop:disable Naming/
|
413
|
+
def is_formula? # rubocop:disable Naming/PredicatePrefix
|
414
414
|
return false if escape_formulas
|
415
415
|
|
416
416
|
type == :string && @value.to_s.start_with?(FORMULA_PREFIX)
|
417
417
|
end
|
418
418
|
|
419
|
-
def is_array_formula? # rubocop:disable Naming/
|
419
|
+
def is_array_formula? # rubocop:disable Naming/PredicatePrefix
|
420
420
|
return false if escape_formulas
|
421
421
|
|
422
422
|
type == :string &&
|
@@ -7,7 +7,7 @@ module Axlsx
|
|
7
7
|
# of plain text and control characters. A fairly comprehensive list of control
|
8
8
|
# characters can be found here:
|
9
9
|
# https://github.com/randym/axlsx/blob/master/notes_on_header_footer.md
|
10
|
-
#
|
10
|
+
#
|
11
11
|
# @note The recommended way of managing header/footers is via Worksheet#header_footer
|
12
12
|
# @see Worksheet#initialize
|
13
13
|
class HeaderFooter
|
@@ -343,7 +343,7 @@ module Axlsx
|
|
343
343
|
attributes << 'dataField="1"'
|
344
344
|
end
|
345
345
|
|
346
|
-
"<pivotField #{attributes.join(' ')}>#{
|
346
|
+
"<pivotField #{attributes.join(' ')}>#{items_tag if include_items_tag}</pivotField>"
|
347
347
|
end
|
348
348
|
|
349
349
|
def data_refs
|
@@ -10,6 +10,7 @@ module Axlsx
|
|
10
10
|
include Axlsx::OptionsParser
|
11
11
|
include Axlsx::SerializedAttributes
|
12
12
|
include Axlsx::Accessors
|
13
|
+
|
13
14
|
# Creates a new PrintOptions object
|
14
15
|
# @option options [Boolean] grid_lines Whether grid lines should be printed
|
15
16
|
# @option options [Boolean] headings Whether row and column headings should be printed
|
@@ -37,7 +37,7 @@ module Axlsx
|
|
37
37
|
|
38
38
|
# Helper method to tell us if there are comments in the comments collection
|
39
39
|
# @return [Boolean]
|
40
|
-
def has_comments? # rubocop:disable Naming/
|
40
|
+
def has_comments? # rubocop:disable Naming/PredicatePrefix
|
41
41
|
!comments.empty?
|
42
42
|
end
|
43
43
|
|
@@ -42,7 +42,7 @@ module Axlsx
|
|
42
42
|
|
43
43
|
# helper method to tell us if the drawing has something in it or not
|
44
44
|
# @return [Boolean]
|
45
|
-
def has_drawing? # rubocop:disable Naming/
|
45
|
+
def has_drawing? # rubocop:disable Naming/PredicatePrefix
|
46
46
|
@drawing.is_a? Drawing
|
47
47
|
end
|
48
48
|
|
@@ -6,6 +6,7 @@ module Axlsx
|
|
6
6
|
include Axlsx::OptionsParser
|
7
7
|
include Axlsx::Accessors
|
8
8
|
include Axlsx::SerializedAttributes
|
9
|
+
|
9
10
|
# Creates a new hyperlink object.
|
10
11
|
# @note the preferred way to add hyperlinks to your worksheet is the Worksheet#add_hyperlink method
|
11
12
|
# @param [Worksheet] worksheet the Worksheet that owns this hyperlink
|
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: caxlsx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Randy Morgan
|
8
8
|
- Jurriaan Pruis
|
9
|
-
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: htmlentities
|
@@ -71,20 +70,20 @@ dependencies:
|
|
71
70
|
requirements:
|
72
71
|
- - ">="
|
73
72
|
- !ruby/object:Gem::Version
|
74
|
-
version:
|
73
|
+
version: '2.4'
|
75
74
|
- - "<"
|
76
75
|
- !ruby/object:Gem::Version
|
77
|
-
version: '
|
76
|
+
version: '4'
|
78
77
|
type: :runtime
|
79
78
|
prerelease: false
|
80
79
|
version_requirements: !ruby/object:Gem::Requirement
|
81
80
|
requirements:
|
82
81
|
- - ">="
|
83
82
|
- !ruby/object:Gem::Version
|
84
|
-
version:
|
83
|
+
version: '2.4'
|
85
84
|
- - "<"
|
86
85
|
- !ruby/object:Gem::Version
|
87
|
-
version: '
|
86
|
+
version: '4'
|
88
87
|
description: 'xlsx spreadsheet generation with charts, images, automated column width,
|
89
88
|
customizable styles and full schema validation. Axlsx helps you create beautiful
|
90
89
|
Office Open XML Spreadsheet documents (Excel, Google Spreadsheets, Numbers, LibreOffice)
|
@@ -297,7 +296,6 @@ metadata:
|
|
297
296
|
changelog_uri: https://github.com/caxlsx/caxlsx/blob/master/CHANGELOG.md
|
298
297
|
source_code_uri: https://github.com/caxlsx/caxlsx
|
299
298
|
rubygems_mfa_required: 'true'
|
300
|
-
post_install_message:
|
301
299
|
rdoc_options: []
|
302
300
|
require_paths:
|
303
301
|
- lib
|
@@ -312,8 +310,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
312
310
|
- !ruby/object:Gem::Version
|
313
311
|
version: '0'
|
314
312
|
requirements: []
|
315
|
-
rubygems_version: 3.
|
316
|
-
signing_key:
|
313
|
+
rubygems_version: 3.6.9
|
317
314
|
specification_version: 4
|
318
315
|
summary: Excel OOXML (xlsx) with charts, styles, images and autowidth columns.
|
319
316
|
test_files: []
|