xlsxrb 0.1.4 → 0.1.6
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/.devcontainer/Dockerfile +1 -1
- data/.gem_rbs_collection/ast/2.4/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/ast/2.4/ast.rbs +73 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/array.rbs +4 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/atomic_reference.rbs +16 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/executor.rbs +96 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/hash.rbs +4 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/map.rbs +68 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/promises.rbs +249 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/set.rbs +4 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/timer_task.rbs +47 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/utility/processor_counter.rbs +5 -0
- data/.gem_rbs_collection/csv/3.3/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/csv/3.3/csv.rbs +3871 -0
- data/.gem_rbs_collection/csv/3.3/manifest.yaml +3 -0
- data/.gem_rbs_collection/lint_roller/1.1/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/lint_roller/1.1/lint_roller.rbs +48 -0
- data/.gem_rbs_collection/listen/3.9/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/listen/3.9/listen.rbs +25 -0
- data/.gem_rbs_collection/listen/3.9/listener.rbs +24 -0
- data/.gem_rbs_collection/logger/1.7/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/logger/1.7/formatter.rbs +45 -0
- data/.gem_rbs_collection/logger/1.7/log_device.rbs +100 -0
- data/.gem_rbs_collection/logger/1.7/logger.rbs +796 -0
- data/.gem_rbs_collection/logger/1.7/manifest.yaml +2 -0
- data/.gem_rbs_collection/logger/1.7/period.rbs +17 -0
- data/.gem_rbs_collection/logger/1.7/severity.rbs +34 -0
- data/.gem_rbs_collection/nokogiri/1.11/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/nokogiri/1.11/nokogiri.rbs +2332 -0
- data/.gem_rbs_collection/nokogiri/1.11/patch.rbs +4 -0
- data/.gem_rbs_collection/parallel/1.20/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/parallel/1.20/parallel.rbs +86 -0
- data/.gem_rbs_collection/parser/3.2/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/parser/3.2/manifest.yaml +7 -0
- data/.gem_rbs_collection/parser/3.2/parser.rbs +194 -0
- data/.gem_rbs_collection/parser/3.2/polyfill.rbs +4 -0
- data/.gem_rbs_collection/rainbow/3.0/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/rainbow/3.0/global.rbs +7 -0
- data/.gem_rbs_collection/rainbow/3.0/presenter.rbs +209 -0
- data/.gem_rbs_collection/rainbow/3.0/rainbow.rbs +5 -0
- data/.gem_rbs_collection/rake/13.0/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/rake/13.0/manifest.yaml +2 -0
- data/.gem_rbs_collection/rake/13.0/rake.rbs +39 -0
- data/.gem_rbs_collection/regexp_parser/2.8/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/regexp_parser/2.8/regexp_parser.rbs +17 -0
- data/.gem_rbs_collection/rubocop/1.57/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/rubocop/1.57/rubocop.rbs +208 -0
- data/.gem_rbs_collection/rubocop-ast/1.46/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/rubocop-ast/1.46/rubocop-ast.rbs +903 -0
- data/.gem_rbs_collection/rubyzip/3.2/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/rubyzip/3.2/manifest.yaml +8 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/central_directory.rbs +42 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/compressor.rbs +5 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/constants.rbs +47 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/crypto/aes_encryption.rbs +30 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/crypto/decrypted_io.rbs +9 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/crypto/encryption.rbs +7 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/crypto/null_encryption.rbs +19 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/crypto/traditional_encryption.rbs +31 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/decompressor.rbs +18 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/deflater.rbs +12 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/dirtyable.rbs +11 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/dos_time.rbs +13 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/entry.rbs +95 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/entry_set.rbs +31 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/errors.rbs +58 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/extra_field/aes.rbs +24 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/extra_field/generic.rbs +17 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/extra_field/ntfs.rbs +23 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/extra_field/old_unix.rbs +22 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/extra_field/universal_time.rbs +30 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/extra_field/unix.rbs +20 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/extra_field/unknown.rbs +15 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/extra_field/zip64.rbs +26 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/extra_field.rbs +21 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/file.rbs +131 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/file_split.rbs +14 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/filesystem/dir.rbs +33 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/filesystem/directory_iterator.rbs +21 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/filesystem/file.rbs +63 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/filesystem/file_stat.rbs +55 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/filesystem/zip_file_name_mapper.rbs +35 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/filesystem.rbs +7 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/inflater.rbs +10 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/input_stream.rbs +22 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/ioextras/abstract_input_stream.rbs +29 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/ioextras/abstract_output_stream.rbs +17 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/ioextras.rbs +13 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/null_compressor.rbs +10 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/null_decompressor.rbs +8 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/null_input_stream.rbs +6 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/output_stream.rbs +30 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/pass_thru_compressor.rbs +10 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/pass_thru_decompressor.rbs +10 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/streamable_directory.rbs +5 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/streamable_stream.rbs +15 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip/version.rbs +3 -0
- data/.gem_rbs_collection/rubyzip/3.2/zip.rbs +40 -0
- data/CHANGELOG.md +42 -3
- data/README.md +130 -49
- data/Rakefile +23 -2
- data/Steepfile +17 -0
- data/benchmark.rb +324 -348
- data/docs/ARCHITECTURE.md +24 -0
- data/docs/DEVELOPMENT.md +58 -0
- data/docs/QUALITY_ASSURANCE.md +26 -0
- data/docs/visual/VisualGallery.md +893 -938
- data/docs/wasm/ruby.wasm +0 -0
- data/lib/xlsxrb/elements/cell.rb +113 -8
- data/lib/xlsxrb/elements/column.rb +2 -0
- data/lib/xlsxrb/elements/row.rb +52 -4
- data/lib/xlsxrb/elements/types.rb +6 -0
- data/lib/xlsxrb/elements/workbook.rb +29 -0
- data/lib/xlsxrb/elements/worksheet.rb +98 -1
- data/lib/xlsxrb/elements.rb +2 -0
- data/lib/xlsxrb/ooxml/reader.rb +8 -6
- data/lib/xlsxrb/ooxml/shared_strings_parser.rb +106 -40
- data/lib/xlsxrb/ooxml/styles_parser.rb +2 -0
- data/lib/xlsxrb/ooxml/utils.rb +2 -0
- data/lib/xlsxrb/ooxml/workbook_parser.rb +6 -1
- data/lib/xlsxrb/ooxml/workbook_writer.rb +15 -4
- data/lib/xlsxrb/ooxml/worksheet_parser.rb +156 -23
- data/lib/xlsxrb/ooxml/worksheet_writer.rb +207 -152
- data/lib/xlsxrb/ooxml/writer.rb +217 -5
- data/lib/xlsxrb/ooxml/xml_builder.rb +18 -10
- data/lib/xlsxrb/ooxml/xml_parser.rb +2 -0
- data/lib/xlsxrb/ooxml/zip_generator.rb +5 -8
- data/lib/xlsxrb/ooxml/zip_reader.rb +179 -57
- data/lib/xlsxrb/ooxml/zip_writer.rb +65 -25
- data/lib/xlsxrb/ooxml.rb +3 -1
- data/lib/xlsxrb/style_builder.rb +284 -36
- data/lib/xlsxrb/version.rb +3 -1
- data/lib/xlsxrb.rb +1761 -275
- data/rbs_collection.lock.yaml +252 -0
- data/rbs_collection.yaml +19 -0
- data/sig/generated/xlsxrb/elements/cell.rbs +30 -0
- data/sig/generated/xlsxrb/elements/column.rbs +30 -0
- data/sig/generated/xlsxrb/elements/row.rbs +32 -0
- data/sig/generated/xlsxrb/elements/types.rbs +74 -0
- data/sig/generated/xlsxrb/elements/workbook.rbs +25 -0
- data/sig/generated/xlsxrb/elements/worksheet.rbs +27 -0
- data/sig/generated/xlsxrb/elements.rbs +8 -0
- data/sig/generated/xlsxrb/ooxml/reader.rbs +1412 -0
- data/sig/generated/xlsxrb/ooxml/shared_strings_parser.rbs +21 -0
- data/sig/generated/xlsxrb/ooxml/styles_parser.rbs +44 -0
- data/sig/generated/xlsxrb/ooxml/utils.rbs +40 -0
- data/sig/generated/xlsxrb/ooxml/workbook_parser.rbs +46 -0
- data/sig/generated/xlsxrb/ooxml/workbook_writer.rbs +66 -0
- data/sig/generated/xlsxrb/ooxml/worksheet_parser.rbs +67 -0
- data/sig/generated/xlsxrb/ooxml/worksheet_writer.rbs +92 -0
- data/sig/generated/xlsxrb/ooxml/writer.rbs +880 -0
- data/sig/generated/xlsxrb/ooxml/xml_builder.rbs +45 -0
- data/sig/generated/xlsxrb/ooxml/xml_parser.rbs +30 -0
- data/sig/generated/xlsxrb/ooxml/zip_generator.rbs +38 -0
- data/sig/generated/xlsxrb/ooxml/zip_reader.rbs +45 -0
- data/sig/generated/xlsxrb/ooxml/zip_writer.rbs +45 -0
- data/sig/generated/xlsxrb/ooxml.rbs +23 -0
- data/sig/generated/xlsxrb/style_builder.rbs +250 -0
- data/sig/generated/xlsxrb/version.rbs +5 -0
- data/sig/generated/xlsxrb.rbs +1276 -0
- data/sig/rexml.rbs +4 -0
- metadata +145 -4
- data/measure_memory.rb +0 -42
- data/sig/xlsxrb.rbs +0 -23
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Generated from lib/xlsxrb/ooxml/shared_strings_parser.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Xlsxrb
|
|
4
|
+
module Ooxml
|
|
5
|
+
# SAX-based parser for xl/sharedStrings.xml.
|
|
6
|
+
# Returns an Array of strings (index = SST index).
|
|
7
|
+
class SharedStringsParser
|
|
8
|
+
XML_ENTITIES: untyped
|
|
9
|
+
|
|
10
|
+
# Parses all shared strings and returns an Array of strings.
|
|
11
|
+
def self.parse: (untyped xml_string, ?_part_name: untyped) -> untyped
|
|
12
|
+
|
|
13
|
+
# Yields Event objects for each shared string.
|
|
14
|
+
def self.each_event: (untyped xml_string, ?part_name: untyped) ?{ (?) -> untyped } -> untyped
|
|
15
|
+
|
|
16
|
+
def self.fast_scan: (untyped xml_src) -> untyped
|
|
17
|
+
|
|
18
|
+
def self.extract_multi_t: (untyped xml, untyped from, untyped to) -> untyped
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Generated from lib/xlsxrb/ooxml/styles_parser.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Xlsxrb
|
|
4
|
+
module Ooxml
|
|
5
|
+
# SAX-based parser for xl/styles.xml.
|
|
6
|
+
# Returns a Hash with :num_fmts, :fonts, :fills, :borders, :cell_xfs, :cell_style_xfs.
|
|
7
|
+
class StylesParser
|
|
8
|
+
def self.parse: (untyped xml_string) -> untyped
|
|
9
|
+
|
|
10
|
+
# SAX listener for parsing styles.xml content.
|
|
11
|
+
class Listener
|
|
12
|
+
include REXML::SAX2Listener
|
|
13
|
+
|
|
14
|
+
attr_reader result: untyped
|
|
15
|
+
|
|
16
|
+
def initialize: () -> untyped
|
|
17
|
+
|
|
18
|
+
def start_element: (untyped _uri, untyped localname, untyped _qname, untyped attrs) -> untyped
|
|
19
|
+
|
|
20
|
+
def end_element: (untyped _uri, untyped localname, untyped _qname) -> untyped
|
|
21
|
+
|
|
22
|
+
def characters: (untyped _text) -> untyped
|
|
23
|
+
|
|
24
|
+
private
|
|
25
|
+
|
|
26
|
+
def parent_context?: (untyped tag) -> untyped
|
|
27
|
+
|
|
28
|
+
def handle_color: (untyped attrs) -> untyped
|
|
29
|
+
|
|
30
|
+
def handle_fill_color: (untyped localname, untyped attrs) -> untyped
|
|
31
|
+
|
|
32
|
+
def handle_border_side: (untyped side, untyped attrs) -> untyped
|
|
33
|
+
|
|
34
|
+
def handle_xf: (untyped attrs) -> untyped
|
|
35
|
+
|
|
36
|
+
def handle_alignment: (untyped attrs) -> untyped
|
|
37
|
+
|
|
38
|
+
def finalize_xf: () -> untyped
|
|
39
|
+
|
|
40
|
+
def extract_color: (untyped attrs) -> untyped
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Generated from lib/xlsxrb/ooxml/utils.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Xlsxrb
|
|
4
|
+
module Ooxml
|
|
5
|
+
# OOXML-specific utility methods and constants.
|
|
6
|
+
module Utils
|
|
7
|
+
# Excel 1900 date system epoch.
|
|
8
|
+
EPOCH_1900: untyped
|
|
9
|
+
|
|
10
|
+
# Built-in number format codes defined by SpreadsheetML.
|
|
11
|
+
BUILTIN_NUM_FMT_CODES: untyped
|
|
12
|
+
|
|
13
|
+
# Built-in numFmtIds that represent date/time formats.
|
|
14
|
+
BUILTIN_DATE_FMT_IDS: untyped
|
|
15
|
+
|
|
16
|
+
# Default date format code used by Writer for Date cells.
|
|
17
|
+
DEFAULT_DATE_FORMAT: ::String
|
|
18
|
+
|
|
19
|
+
# Default date-time format code used by Writer for Time cells.
|
|
20
|
+
DEFAULT_DATETIME_FORMAT: ::String
|
|
21
|
+
|
|
22
|
+
# Converts a Date to an Excel serial number (1900 system).
|
|
23
|
+
def self.date_to_serial: (untyped date) -> untyped
|
|
24
|
+
|
|
25
|
+
# Converts an Excel serial number (1900 system) to a Date.
|
|
26
|
+
def self.serial_to_date: (untyped serial) -> untyped
|
|
27
|
+
|
|
28
|
+
# Converts a Time to a fractional Excel serial number (1900 system).
|
|
29
|
+
def self.datetime_to_serial: (untyped time) -> untyped
|
|
30
|
+
|
|
31
|
+
# Converts a fractional Excel serial number to a Time (1900 system, UTC).
|
|
32
|
+
def self.serial_to_datetime: (untyped serial) -> untyped
|
|
33
|
+
|
|
34
|
+
# Hashes a plain-text password for use with sheet/workbook protection.
|
|
35
|
+
# Returns { algorithm_name:, hash_value:, salt_value:, spin_count: }.
|
|
36
|
+
# Algorithm per ECMA-376 Part 4 §2.4.2.24.
|
|
37
|
+
def self.hash_password: (untyped password, ?algorithm: untyped, ?salt: untyped, ?spin_count: untyped) -> untyped
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Generated from lib/xlsxrb/ooxml/workbook_parser.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Xlsxrb
|
|
4
|
+
module Ooxml
|
|
5
|
+
# SAX-based parser for xl/workbook.xml.
|
|
6
|
+
# Returns sheet list: [{ name:, sheet_id:, r_id: }, ...].
|
|
7
|
+
class WorkbookParser
|
|
8
|
+
def self.parse: (untyped xml_string) -> untyped
|
|
9
|
+
|
|
10
|
+
# SAX listener for workbook.xml sheets.
|
|
11
|
+
class Listener
|
|
12
|
+
include REXML::SAX2Listener
|
|
13
|
+
|
|
14
|
+
attr_reader sheets: untyped
|
|
15
|
+
|
|
16
|
+
def initialize: () -> untyped
|
|
17
|
+
|
|
18
|
+
def start_element: (untyped _uri, untyped localname, untyped _qname, untyped attrs) -> untyped
|
|
19
|
+
|
|
20
|
+
def end_element: (untyped _uri, untyped _localname, untyped _qname) -> untyped
|
|
21
|
+
|
|
22
|
+
def characters: (untyped _text) -> untyped
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# Parses .rels files to build rId -> target mapping.
|
|
27
|
+
class RelationshipsParser
|
|
28
|
+
def self.parse: (untyped xml_string) -> untyped
|
|
29
|
+
|
|
30
|
+
# SAX listener for .rels relationship files.
|
|
31
|
+
class Listener
|
|
32
|
+
include REXML::SAX2Listener
|
|
33
|
+
|
|
34
|
+
attr_reader relationships: untyped
|
|
35
|
+
|
|
36
|
+
def initialize: () -> untyped
|
|
37
|
+
|
|
38
|
+
def start_element: (untyped _uri, untyped localname, untyped _qname, untyped attrs) -> untyped
|
|
39
|
+
|
|
40
|
+
def end_element: (untyped _uri, untyped _localname, untyped _qname) -> untyped
|
|
41
|
+
|
|
42
|
+
def characters: (untyped _text) -> untyped
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Generated from lib/xlsxrb/ooxml/workbook_writer.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Xlsxrb
|
|
4
|
+
module Ooxml
|
|
5
|
+
# Orchestrates writing a complete XLSX workbook.
|
|
6
|
+
# Generates all required OpenXML parts and assembles them into a ZIP.
|
|
7
|
+
class WorkbookWriter
|
|
8
|
+
SSML_NS: ::String
|
|
9
|
+
|
|
10
|
+
REL_NS: ::String
|
|
11
|
+
|
|
12
|
+
CT_NS: ::String
|
|
13
|
+
|
|
14
|
+
DOC_REL: ::String
|
|
15
|
+
|
|
16
|
+
# Wraps a ZipWriter entry to provide a standard IO-like #write interface.
|
|
17
|
+
class ZipEntryIO
|
|
18
|
+
def initialize: (untyped zip) -> untyped
|
|
19
|
+
|
|
20
|
+
def write: (untyped data) -> untyped
|
|
21
|
+
|
|
22
|
+
alias << write
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def self.write: (untyped target, sheets: untyped, ?shared_strings: untyped, ?shared_strings_index: untyped, ?styles: untyped, ?defined_names: untyped, ?core_properties: untyped, ?app_properties: untyped, ?custom_properties: untyped, ?workbook_protection: untyped, ?workbook_properties: untyped) -> untyped
|
|
26
|
+
|
|
27
|
+
def initialize: (sheets: untyped, ?shared_strings: untyped, ?shared_strings_index: untyped, ?styles: untyped, ?defined_names: untyped, ?core_properties: untyped, ?app_properties: untyped, ?custom_properties: untyped, ?workbook_protection: untyped, ?workbook_properties: untyped) -> untyped
|
|
28
|
+
|
|
29
|
+
def write_to: (untyped target) -> untyped
|
|
30
|
+
|
|
31
|
+
private
|
|
32
|
+
|
|
33
|
+
def build_sheet_rels_from_list: (untyped rels) -> untyped
|
|
34
|
+
|
|
35
|
+
def build_content_types: () -> untyped
|
|
36
|
+
|
|
37
|
+
def build_root_rels: () -> untyped
|
|
38
|
+
|
|
39
|
+
def build_workbook_xml: () -> untyped
|
|
40
|
+
|
|
41
|
+
def build_workbook_rels: () -> untyped
|
|
42
|
+
|
|
43
|
+
def build_styles_xml: () -> untyped
|
|
44
|
+
|
|
45
|
+
def preprocess_conditional_formats!: () -> untyped
|
|
46
|
+
|
|
47
|
+
def extract_dxf_from_rule!: (untyped rule) -> untyped
|
|
48
|
+
|
|
49
|
+
def write_dxf_font: (untyped builder, untyped font) -> untyped
|
|
50
|
+
|
|
51
|
+
def write_dxf_fill: (untyped builder, untyped fill) -> untyped
|
|
52
|
+
|
|
53
|
+
def build_shared_strings_xml: () -> untyped
|
|
54
|
+
|
|
55
|
+
def write_worksheet_xml: (untyped io, untyped sheet, ?drawing_rid: untyped, ?sheet_protection: untyped, ?auto_filter: untyped, ?filter_columns: untyped, ?sort_state: untyped, ?merge_cells: untyped, ?conditional_formats: untyped, ?data_validations: untyped, ?hyperlinks: untyped, ?print_options: untyped, ?page_margins: untyped, ?page_setup: untyped, ?header_footer: untyped, ?row_breaks: untyped, ?col_breaks: untyped, ?freeze_pane: untyped, ?split_pane: untyped, ?selection: untyped, ?sheet_view: untyped, ?sheet_properties: untyped, ?tables: untyped, ?table_start_rid: untyped, ?legacy_drawing_rid: untyped, ?sparkline_groups: untyped) -> untyped
|
|
56
|
+
|
|
57
|
+
def build_table_xml: (untyped tbl, untyped table_id) -> untyped
|
|
58
|
+
|
|
59
|
+
def build_core_properties_xml: () -> untyped
|
|
60
|
+
|
|
61
|
+
def build_app_properties_xml: () -> untyped
|
|
62
|
+
|
|
63
|
+
def build_custom_properties_xml: () -> untyped
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Generated from lib/xlsxrb/ooxml/worksheet_parser.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Xlsxrb
|
|
4
|
+
module Ooxml
|
|
5
|
+
# Streaming parser for xl/worksheets/sheetN.xml.
|
|
6
|
+
# Uses a fast string-scanning approach for row/cell extraction,
|
|
7
|
+
# falling back to REXML SAX only for column definitions and unmapped data.
|
|
8
|
+
class WorksheetParser
|
|
9
|
+
EMPTY_ARRAY: untyped
|
|
10
|
+
|
|
11
|
+
EMPTY_HASH: untyped
|
|
12
|
+
|
|
13
|
+
# Parses all rows from a worksheet XML string.
|
|
14
|
+
# Returns an Array of raw row hashes:
|
|
15
|
+
# { index:, cells: [{ ref:, type:, style_index:, value:, formula: }], attrs:, unmapped: }
|
|
16
|
+
def self.parse: (untyped xml_string, ?shared_strings: untyped) -> untyped
|
|
17
|
+
|
|
18
|
+
# Streaming parse: yields one raw row hash at a time.
|
|
19
|
+
def self.each_row: (untyped xml_string, ?shared_strings: untyped, ?part_name: untyped) ?{ (?) -> untyped } -> untyped
|
|
20
|
+
|
|
21
|
+
# Parses column definitions (<cols>) from a worksheet.
|
|
22
|
+
def self.parse_columns: (untyped xml_string, ?part_name: untyped) -> untyped
|
|
23
|
+
|
|
24
|
+
# Yields Event objects for columns, rows, cells, and hyperlinks.
|
|
25
|
+
def self.each_event: (untyped xml_string, ?shared_strings: untyped, ?part_name: untyped) ?{ (?) -> untyped } -> untyped
|
|
26
|
+
|
|
27
|
+
def self.fast_scan_events: (untyped xml_src, untyped shared_strings, untyped part_name) ?{ (?) -> untyped } -> untyped
|
|
28
|
+
|
|
29
|
+
def self.extract_row_attrs: (untyped row_tag) -> untyped
|
|
30
|
+
|
|
31
|
+
# Extract an attribute value from a small tag substring (bounded search).
|
|
32
|
+
def self.tag_attr: (untyped tag, untyped prefix) -> untyped
|
|
33
|
+
|
|
34
|
+
def self.fast_scan_cells_events: (untyped xml, untyped from, untyped to, untyped shared_strings, untyped row_source) ?{ (?) -> untyped } -> untyped
|
|
35
|
+
|
|
36
|
+
def self.extract_inline_text: (untyped xml, untyped from, untyped to) -> untyped
|
|
37
|
+
|
|
38
|
+
def self.resolve_fast_value: (untyped raw, untyped type, untyped shared_strings) -> untyped
|
|
39
|
+
|
|
40
|
+
XML_ENTITIES: untyped
|
|
41
|
+
|
|
42
|
+
# SECURITY NOTE: Decodes only standard predefined XML entities in a single pass.
|
|
43
|
+
# This completely prevents "Billion Laughs" attacks (exponential entity expansion)
|
|
44
|
+
# because it avoids recursive expansion and ignores custom entities entirely.
|
|
45
|
+
def self.decode_xml_entities: (untyped str) -> untyped
|
|
46
|
+
|
|
47
|
+
# Parses <cols> section for column definitions.
|
|
48
|
+
class ColumnsListener
|
|
49
|
+
include REXML::SAX2Listener
|
|
50
|
+
|
|
51
|
+
attr_reader columns: untyped
|
|
52
|
+
|
|
53
|
+
def initialize: () -> untyped
|
|
54
|
+
|
|
55
|
+
def start_element: (untyped _uri, untyped localname, untyped _qname, untyped attrs) -> untyped
|
|
56
|
+
|
|
57
|
+
def end_element: (untyped _uri, untyped localname, untyped _qname) -> untyped
|
|
58
|
+
|
|
59
|
+
def characters: (untyped _text) -> untyped
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def self.fast_scan_rows_direct: (untyped xml_src, untyped shared_strings, untyped part_name) ?{ (?) -> untyped } -> untyped
|
|
63
|
+
|
|
64
|
+
def self.fast_parse_cells_direct: (untyped xml, untyped from, untyped to, untyped shared_strings, untyped row_source) -> untyped
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Generated from lib/xlsxrb/ooxml/worksheet_writer.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Xlsxrb
|
|
4
|
+
module Ooxml
|
|
5
|
+
# Generates worksheet XML for a list of rows.
|
|
6
|
+
# Supports streaming: rows can be written one at a time.
|
|
7
|
+
class WorksheetWriter
|
|
8
|
+
SSML_NS: ::String
|
|
9
|
+
|
|
10
|
+
DOC_REL_NS: ::String
|
|
11
|
+
|
|
12
|
+
def initialize: (untyped io) -> untyped
|
|
13
|
+
|
|
14
|
+
# Write the worksheet header. Call once before writing rows.
|
|
15
|
+
# Options for pre-sheetData elements:
|
|
16
|
+
# sheet_properties: Hash of sheet-level properties (:tab_color, etc.)
|
|
17
|
+
# freeze_pane: { row:, col:, state: :frozen }
|
|
18
|
+
# split_pane: { x_split:, y_split:, top_left_cell: }
|
|
19
|
+
# selection: { active_cell:, sqref:, pane: }
|
|
20
|
+
# sheet_view: Hash of sheet view properties
|
|
21
|
+
def start: (?columns: untyped, ?sheet_properties: untyped, ?freeze_pane: untyped, ?split_pane: untyped, ?selection: untyped, ?sheet_view: untyped) -> untyped
|
|
22
|
+
|
|
23
|
+
# Write a single row. Automatically calls start if needed.
|
|
24
|
+
def write_row: (untyped row_index, untyped cells, ?attrs: untyped, ?unmapped: untyped, ?sst_index: untyped) -> untyped
|
|
25
|
+
|
|
26
|
+
# Highly optimized row writing for StreamWriter that avoids allocating intermediate Hashes.
|
|
27
|
+
def write_row_values: (untyped row_index, untyped values, ?styles: untyped, ?style_map: untyped, ?sst: untyped, ?sst_index: untyped, ?attrs: untyped) -> untyped
|
|
28
|
+
|
|
29
|
+
# Write the worksheet footer. Call once after all rows.
|
|
30
|
+
# Options for post-sheetData elements (in OOXML order):
|
|
31
|
+
def finish: (?drawing_rid: untyped, ?sheet_protection: untyped, ?auto_filter: untyped, ?filter_columns: untyped, ?sort_state: untyped, ?merge_cells: untyped, ?conditional_formats: untyped, ?data_validations: untyped, ?hyperlinks: untyped, ?print_options: untyped, ?page_margins: untyped, ?page_setup: untyped, ?header_footer: untyped, ?row_breaks: untyped, ?col_breaks: untyped, ?tables: untyped, ?table_start_rid: untyped, ?legacy_drawing_rid: untyped, ?sparkline_groups: untyped) -> untyped
|
|
32
|
+
|
|
33
|
+
private
|
|
34
|
+
|
|
35
|
+
def write_sheet_properties: (untyped props) -> untyped
|
|
36
|
+
|
|
37
|
+
def write_sheet_views: (?freeze_pane: untyped, ?split_pane: untyped, ?selection: untyped, ?sheet_view: untyped) -> untyped
|
|
38
|
+
|
|
39
|
+
def write_sheet_protection: (untyped opts) -> untyped
|
|
40
|
+
|
|
41
|
+
def write_auto_filter: (untyped range, untyped filter_columns, untyped sort_state) -> untyped
|
|
42
|
+
|
|
43
|
+
def write_filter_column: (untyped col_id, untyped filter) -> untyped
|
|
44
|
+
|
|
45
|
+
def write_merge_cells: (untyped ranges) -> untyped
|
|
46
|
+
|
|
47
|
+
def write_conditional_formatting: (untyped rules) -> untyped
|
|
48
|
+
|
|
49
|
+
def write_data_validations: (untyped validations) -> untyped
|
|
50
|
+
|
|
51
|
+
def write_hyperlinks: (untyped links) -> untyped
|
|
52
|
+
|
|
53
|
+
def write_print_options: (untyped opts) -> untyped
|
|
54
|
+
|
|
55
|
+
def write_page_margins: (untyped margins) -> untyped
|
|
56
|
+
|
|
57
|
+
def write_page_setup: (untyped opts) -> untyped
|
|
58
|
+
|
|
59
|
+
def write_header_footer: (untyped opts) -> untyped
|
|
60
|
+
|
|
61
|
+
def write_row_breaks: (untyped breaks) -> untyped
|
|
62
|
+
|
|
63
|
+
def write_col_breaks: (untyped breaks) -> untyped
|
|
64
|
+
|
|
65
|
+
def write_table_parts: (untyped tables, untyped start_rid) -> untyped
|
|
66
|
+
|
|
67
|
+
def write_sparklines: (untyped groups) -> untyped
|
|
68
|
+
|
|
69
|
+
def write_sparkline_color: (untyped tag, untyped color) -> untyped
|
|
70
|
+
|
|
71
|
+
def write_columns: (untyped columns) -> untyped
|
|
72
|
+
|
|
73
|
+
def write_cell: (untyped cell) -> untyped
|
|
74
|
+
|
|
75
|
+
def cell_type: (untyped value) -> untyped
|
|
76
|
+
|
|
77
|
+
def xml_cell_value: (untyped value, untyped _type) -> untyped
|
|
78
|
+
|
|
79
|
+
def cell_ref: (untyped row_index, untyped col_index) -> untyped
|
|
80
|
+
|
|
81
|
+
def column_letter: (untyped index) -> untyped
|
|
82
|
+
|
|
83
|
+
INVALID_XML_CHARS_RE: ::Regexp
|
|
84
|
+
|
|
85
|
+
ESCAPE_RE: ::Regexp
|
|
86
|
+
|
|
87
|
+
ESCAPE_MAP: untyped
|
|
88
|
+
|
|
89
|
+
def escape_xml: (untyped value) -> untyped
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
end
|