xlsxrb 0.1.5 → 0.1.7

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.
Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. data/.gem_rbs_collection/nokogiri/1.11/.rbs_meta.yaml +9 -0
  3. data/.gem_rbs_collection/nokogiri/1.11/nokogiri.rbs +2332 -0
  4. data/.gem_rbs_collection/nokogiri/1.11/patch.rbs +4 -0
  5. data/.gem_rbs_collection/rubyzip/3.2/.rbs_meta.yaml +9 -0
  6. data/.gem_rbs_collection/rubyzip/3.2/manifest.yaml +8 -0
  7. data/.gem_rbs_collection/rubyzip/3.2/zip/central_directory.rbs +42 -0
  8. data/.gem_rbs_collection/rubyzip/3.2/zip/compressor.rbs +5 -0
  9. data/.gem_rbs_collection/rubyzip/3.2/zip/constants.rbs +47 -0
  10. data/.gem_rbs_collection/rubyzip/3.2/zip/crypto/aes_encryption.rbs +30 -0
  11. data/.gem_rbs_collection/rubyzip/3.2/zip/crypto/decrypted_io.rbs +9 -0
  12. data/.gem_rbs_collection/rubyzip/3.2/zip/crypto/encryption.rbs +7 -0
  13. data/.gem_rbs_collection/rubyzip/3.2/zip/crypto/null_encryption.rbs +19 -0
  14. data/.gem_rbs_collection/rubyzip/3.2/zip/crypto/traditional_encryption.rbs +31 -0
  15. data/.gem_rbs_collection/rubyzip/3.2/zip/decompressor.rbs +18 -0
  16. data/.gem_rbs_collection/rubyzip/3.2/zip/deflater.rbs +12 -0
  17. data/.gem_rbs_collection/rubyzip/3.2/zip/dirtyable.rbs +11 -0
  18. data/.gem_rbs_collection/rubyzip/3.2/zip/dos_time.rbs +13 -0
  19. data/.gem_rbs_collection/rubyzip/3.2/zip/entry.rbs +95 -0
  20. data/.gem_rbs_collection/rubyzip/3.2/zip/entry_set.rbs +31 -0
  21. data/.gem_rbs_collection/rubyzip/3.2/zip/errors.rbs +58 -0
  22. data/.gem_rbs_collection/rubyzip/3.2/zip/extra_field/aes.rbs +24 -0
  23. data/.gem_rbs_collection/rubyzip/3.2/zip/extra_field/generic.rbs +17 -0
  24. data/.gem_rbs_collection/rubyzip/3.2/zip/extra_field/ntfs.rbs +23 -0
  25. data/.gem_rbs_collection/rubyzip/3.2/zip/extra_field/old_unix.rbs +22 -0
  26. data/.gem_rbs_collection/rubyzip/3.2/zip/extra_field/universal_time.rbs +30 -0
  27. data/.gem_rbs_collection/rubyzip/3.2/zip/extra_field/unix.rbs +20 -0
  28. data/.gem_rbs_collection/rubyzip/3.2/zip/extra_field/unknown.rbs +15 -0
  29. data/.gem_rbs_collection/rubyzip/3.2/zip/extra_field/zip64.rbs +26 -0
  30. data/.gem_rbs_collection/rubyzip/3.2/zip/extra_field.rbs +21 -0
  31. data/.gem_rbs_collection/rubyzip/3.2/zip/file.rbs +131 -0
  32. data/.gem_rbs_collection/rubyzip/3.2/zip/file_split.rbs +14 -0
  33. data/.gem_rbs_collection/rubyzip/3.2/zip/filesystem/dir.rbs +33 -0
  34. data/.gem_rbs_collection/rubyzip/3.2/zip/filesystem/directory_iterator.rbs +21 -0
  35. data/.gem_rbs_collection/rubyzip/3.2/zip/filesystem/file.rbs +63 -0
  36. data/.gem_rbs_collection/rubyzip/3.2/zip/filesystem/file_stat.rbs +55 -0
  37. data/.gem_rbs_collection/rubyzip/3.2/zip/filesystem/zip_file_name_mapper.rbs +35 -0
  38. data/.gem_rbs_collection/rubyzip/3.2/zip/filesystem.rbs +7 -0
  39. data/.gem_rbs_collection/rubyzip/3.2/zip/inflater.rbs +10 -0
  40. data/.gem_rbs_collection/rubyzip/3.2/zip/input_stream.rbs +22 -0
  41. data/.gem_rbs_collection/rubyzip/3.2/zip/ioextras/abstract_input_stream.rbs +29 -0
  42. data/.gem_rbs_collection/rubyzip/3.2/zip/ioextras/abstract_output_stream.rbs +17 -0
  43. data/.gem_rbs_collection/rubyzip/3.2/zip/ioextras.rbs +13 -0
  44. data/.gem_rbs_collection/rubyzip/3.2/zip/null_compressor.rbs +10 -0
  45. data/.gem_rbs_collection/rubyzip/3.2/zip/null_decompressor.rbs +8 -0
  46. data/.gem_rbs_collection/rubyzip/3.2/zip/null_input_stream.rbs +6 -0
  47. data/.gem_rbs_collection/rubyzip/3.2/zip/output_stream.rbs +30 -0
  48. data/.gem_rbs_collection/rubyzip/3.2/zip/pass_thru_compressor.rbs +10 -0
  49. data/.gem_rbs_collection/rubyzip/3.2/zip/pass_thru_decompressor.rbs +10 -0
  50. data/.gem_rbs_collection/rubyzip/3.2/zip/streamable_directory.rbs +5 -0
  51. data/.gem_rbs_collection/rubyzip/3.2/zip/streamable_stream.rbs +15 -0
  52. data/.gem_rbs_collection/rubyzip/3.2/zip/version.rbs +3 -0
  53. data/.gem_rbs_collection/rubyzip/3.2/zip.rbs +40 -0
  54. data/CHANGELOG.md +28 -0
  55. data/README.md +66 -44
  56. data/Rakefile +2 -1
  57. data/Steepfile +1 -2
  58. data/benchmark.rb +376 -0
  59. data/docs/ARCHITECTURE.md +12 -5
  60. data/docs/visual/VisualGallery.md +8 -0
  61. data/docs/wasm/ruby.wasm +0 -0
  62. data/lib/ruby_lsp/xlsxrb/addon.rb +43 -0
  63. data/lib/ruby_lsp/xlsxrb/completion_listener.rb +769 -0
  64. data/lib/xlsxrb/elements/cell.rb +137 -11
  65. data/lib/xlsxrb/elements/column.rb +22 -0
  66. data/lib/xlsxrb/elements/row.rb +98 -5
  67. data/lib/xlsxrb/elements/types.rb +40 -5
  68. data/lib/xlsxrb/elements/workbook.rb +73 -5
  69. data/lib/xlsxrb/elements/worksheet.rb +110 -1
  70. data/lib/xlsxrb/ooxml/shared_strings_parser.rb +104 -40
  71. data/lib/xlsxrb/ooxml/worksheet_parser.rb +144 -23
  72. data/lib/xlsxrb/ooxml/worksheet_writer.rb +160 -145
  73. data/lib/xlsxrb/ooxml/xml_builder.rb +16 -10
  74. data/lib/xlsxrb/ooxml/zip_reader.rb +104 -18
  75. data/lib/xlsxrb/ooxml/zip_writer.rb +63 -25
  76. data/lib/xlsxrb/style_builder.rb +158 -30
  77. data/lib/xlsxrb/version.rb +1 -1
  78. data/lib/xlsxrb.rb +892 -336
  79. data/rbs_collection.lock.yaml +28 -0
  80. data/sig/generated/xlsxrb/elements/cell.rbs +39 -0
  81. data/sig/generated/xlsxrb/elements/column.rbs +35 -0
  82. data/sig/generated/xlsxrb/elements/row.rbs +39 -0
  83. data/sig/generated/xlsxrb/elements/types.rbs +82 -0
  84. data/sig/generated/xlsxrb/elements/workbook.rbs +32 -0
  85. data/sig/generated/xlsxrb/elements/worksheet.rbs +34 -0
  86. data/sig/generated/xlsxrb/ooxml/reader.rbs +1412 -0
  87. data/sig/generated/xlsxrb/ooxml/shared_strings_parser.rbs +21 -0
  88. data/sig/generated/xlsxrb/ooxml/styles_parser.rbs +44 -0
  89. data/sig/generated/xlsxrb/ooxml/utils.rbs +40 -0
  90. data/sig/generated/xlsxrb/ooxml/workbook_parser.rbs +46 -0
  91. data/sig/generated/xlsxrb/ooxml/workbook_writer.rbs +66 -0
  92. data/sig/generated/xlsxrb/ooxml/worksheet_parser.rbs +67 -0
  93. data/sig/generated/xlsxrb/ooxml/worksheet_writer.rbs +92 -0
  94. data/sig/generated/xlsxrb/ooxml/writer.rbs +880 -0
  95. data/sig/generated/xlsxrb/ooxml/xml_builder.rbs +45 -0
  96. data/sig/generated/xlsxrb/ooxml/xml_parser.rbs +30 -0
  97. data/sig/generated/xlsxrb/ooxml/zip_generator.rbs +38 -0
  98. data/sig/generated/xlsxrb/ooxml/zip_reader.rbs +45 -0
  99. data/sig/generated/xlsxrb/ooxml/zip_writer.rbs +45 -0
  100. data/sig/generated/xlsxrb/style_builder.rbs +212 -50
  101. data/sig/generated/xlsxrb.rbs +1646 -0
  102. data/sig/rexml.rbs +4 -0
  103. metadata +78 -1
@@ -61,6 +61,10 @@ gems:
61
61
  version: '0'
62
62
  source:
63
63
  type: stdlib
64
+ - name: language_server-protocol
65
+ version: 3.17.0.6
66
+ source:
67
+ type: rubygems
64
68
  - name: lint_roller
65
69
  version: '1.1'
66
70
  source:
@@ -89,6 +93,14 @@ gems:
89
93
  version: '0'
90
94
  source:
91
95
  type: stdlib
96
+ - name: nokogiri
97
+ version: '1.11'
98
+ source:
99
+ type: git
100
+ name: ruby/gem_rbs_collection
101
+ revision: 9ab762c8247028f90620fc93c4e7aac20eb693d7
102
+ remote: https://github.com/ruby/gem_rbs_collection.git
103
+ repo_dir: gems
92
104
  - name: openssl
93
105
  version: '0'
94
106
  source:
@@ -113,6 +125,10 @@ gems:
113
125
  revision: 82762423fc5694b82888ea89a972847cf19838c2
114
126
  remote: https://github.com/ruby/gem_rbs_collection.git
115
127
  repo_dir: gems
128
+ - name: pbt
129
+ version: 0.7.0
130
+ source:
131
+ type: rubygems
116
132
  - name: pp
117
133
  version: '0'
118
134
  source:
@@ -181,6 +197,14 @@ gems:
181
197
  version: 2.9.4
182
198
  source:
183
199
  type: rubygems
200
+ - name: rubyzip
201
+ version: '3.2'
202
+ source:
203
+ type: git
204
+ name: ruby/gem_rbs_collection
205
+ revision: 9ab762c8247028f90620fc93c4e7aac20eb693d7
206
+ remote: https://github.com/ruby/gem_rbs_collection.git
207
+ repo_dir: gems
184
208
  - name: securerandom
185
209
  version: '0'
186
210
  source:
@@ -221,4 +245,8 @@ gems:
221
245
  version: 1.9.2
222
246
  source:
223
247
  type: rubygems
248
+ - name: zlib
249
+ version: '0'
250
+ source:
251
+ type: stdlib
224
252
  gemfile_lock_path: Gemfile.lock
@@ -0,0 +1,39 @@
1
+ # Generated from lib/xlsxrb/elements/cell.rb with RBS::Inline
2
+
3
+ module Xlsxrb
4
+ module Elements
5
+ # Represents a single cell in a worksheet.
6
+ # All row and column indices are 0-based.
7
+ #
8
+ # @example Access cell properties
9
+ # cell = sheet["A1"]
10
+ # cell.value # raw value
11
+ # cell.ref # "A1"
12
+ # cell.to_i # integer value
13
+ # cell.to_date # Date value
14
+ #
15
+ # @api public
16
+ class Cell < Data
17
+ attr_reader row_index(): untyped
18
+
19
+ attr_reader column_index(): untyped
20
+
21
+ attr_reader value(): untyped
22
+
23
+ attr_reader formula(): untyped
24
+
25
+ attr_reader style_index(): untyped
26
+
27
+ attr_reader unmapped_data(): untyped
28
+
29
+ attr_reader errors(): untyped
30
+
31
+ def self.new: (untyped row_index, untyped column_index, untyped value, untyped formula, untyped style_index, untyped unmapped_data, untyped errors) -> instance
32
+ | (row_index: untyped, column_index: untyped, value: untyped, formula: untyped, style_index: untyped, unmapped_data: untyped, errors: untyped) -> instance
33
+
34
+ def self.members: () -> [ :row_index, :column_index, :value, :formula, :style_index, :unmapped_data, :errors ]
35
+
36
+ def members: () -> [ :row_index, :column_index, :value, :formula, :style_index, :unmapped_data, :errors ]
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,35 @@
1
+ # Generated from lib/xlsxrb/elements/column.rb with RBS::Inline
2
+
3
+ module Xlsxrb
4
+ module Elements
5
+ # Represents column formatting in a worksheet.
6
+ # index is 0-based.
7
+ #
8
+ # @example
9
+ # col = Elements::Column.new(index: 0, width: 25.0)
10
+ #
11
+ # @api public
12
+ class Column < Data
13
+ attr_reader index(): untyped
14
+
15
+ attr_reader width(): untyped
16
+
17
+ attr_reader hidden(): untyped
18
+
19
+ attr_reader custom_width(): untyped
20
+
21
+ attr_reader outline_level(): untyped
22
+
23
+ attr_reader unmapped_data(): untyped
24
+
25
+ attr_reader errors(): untyped
26
+
27
+ def self.new: (untyped index, untyped width, untyped hidden, untyped custom_width, untyped outline_level, untyped unmapped_data, untyped errors) -> instance
28
+ | (index: untyped, width: untyped, hidden: untyped, custom_width: untyped, outline_level: untyped, unmapped_data: untyped, errors: untyped) -> instance
29
+
30
+ def self.members: () -> [ :index, :width, :hidden, :custom_width, :outline_level, :unmapped_data, :errors ]
31
+
32
+ def members: () -> [ :index, :width, :hidden, :custom_width, :outline_level, :unmapped_data, :errors ]
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,39 @@
1
+ # Generated from lib/xlsxrb/elements/row.rb with RBS::Inline
2
+
3
+ module Xlsxrb
4
+ module Elements
5
+ # Represents a single row in a worksheet.
6
+ # All row and column indices are 0-based.
7
+ #
8
+ # @example Access cell by index or symbol
9
+ # row = sheet.row_at(0)
10
+ # cell = row[0] # cell at column 0
11
+ # row.to_a # array of cell values
12
+ #
13
+ # @api public
14
+ class Row < Data
15
+ attr_reader index(): untyped
16
+
17
+ attr_reader cells(): untyped
18
+
19
+ attr_reader height(): untyped
20
+
21
+ attr_reader hidden(): untyped
22
+
23
+ attr_reader custom_height(): untyped
24
+
25
+ attr_reader outline_level(): untyped
26
+
27
+ attr_reader unmapped_data(): untyped
28
+
29
+ attr_reader errors(): untyped
30
+
31
+ def self.new: (untyped index, untyped cells, untyped height, untyped hidden, untyped custom_height, untyped outline_level, untyped unmapped_data, untyped errors) -> instance
32
+ | (index: untyped, cells: untyped, height: untyped, hidden: untyped, custom_height: untyped, outline_level: untyped, unmapped_data: untyped, errors: untyped) -> instance
33
+
34
+ def self.members: () -> [ :index, :cells, :height, :hidden, :custom_height, :outline_level, :unmapped_data, :errors ]
35
+
36
+ def members: () -> [ :index, :cells, :height, :hidden, :custom_height, :outline_level, :unmapped_data, :errors ]
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,82 @@
1
+ # Generated from lib/xlsxrb/elements/types.rb with RBS::Inline
2
+
3
+ module Xlsxrb
4
+ module Elements
5
+ EMPTY_ERRORS: untyped
6
+
7
+ EMPTY_HASH: untyped
8
+
9
+ EMPTY_CELLS: untyped
10
+
11
+ # Represents an Excel formula with an optional cached value and calculation properties.
12
+ #
13
+ # @example Create a formula
14
+ # formula = Elements::Formula.new(expression: "SUM(A1:A10)")
15
+ #
16
+ # @api public
17
+ class Formula < Data
18
+ attr_reader expression(): untyped
19
+
20
+ attr_reader cached_value(): untyped
21
+
22
+ attr_reader type(): untyped
23
+
24
+ attr_reader ref(): untyped
25
+
26
+ attr_reader shared_index(): untyped
27
+
28
+ attr_reader calculate_always(): untyped
29
+
30
+ attr_reader aca(): untyped
31
+
32
+ attr_reader bx(): untyped
33
+
34
+ attr_reader dt2d(): untyped
35
+
36
+ attr_reader dtr(): untyped
37
+
38
+ attr_reader r1(): untyped
39
+
40
+ attr_reader r2(): untyped
41
+
42
+ def self.new: (untyped expression, untyped cached_value, untyped type, untyped ref, untyped shared_index, untyped calculate_always, untyped aca, untyped bx, untyped dt2d, untyped dtr, untyped r1, untyped r2) -> instance
43
+ | (expression: untyped, cached_value: untyped, type: untyped, ref: untyped, shared_index: untyped, calculate_always: untyped, aca: untyped, bx: untyped, dt2d: untyped, dtr: untyped, r1: untyped, r2: untyped) -> instance
44
+
45
+ def self.members: () -> [ :expression, :cached_value, :type, :ref, :shared_index, :calculate_always, :aca, :bx, :dt2d, :dtr, :r1, :r2 ]
46
+
47
+ def members: () -> [ :expression, :cached_value, :type, :ref, :shared_index, :calculate_always, :aca, :bx, :dt2d, :dtr, :r1, :r2 ]
48
+ end
49
+
50
+ # Represents a cell error value (e.g. #N/A, #REF!, #DIV/0!).
51
+ # @api public
52
+ VALID_ERROR_CODES: untyped
53
+
54
+ class CellError < Data
55
+ attr_reader code(): untyped
56
+
57
+ def self.new: (untyped code) -> instance
58
+ | (code: untyped) -> instance
59
+
60
+ def self.members: () -> [ :code ]
61
+
62
+ def members: () -> [ :code ]
63
+ end
64
+
65
+ # Represents a rich text string with multiple formatting runs.
66
+ #
67
+ # @example
68
+ # rt = Elements::RichText.new(runs: [{ text: "Hello ", font: { bold: true } }, { text: "World" }])
69
+ #
70
+ # @api public
71
+ class RichText < Data
72
+ attr_reader runs(): untyped
73
+
74
+ def self.new: (untyped runs) -> instance
75
+ | (runs: untyped) -> instance
76
+
77
+ def self.members: () -> [ :runs ]
78
+
79
+ def members: () -> [ :runs ]
80
+ end
81
+ end
82
+ end
@@ -0,0 +1,32 @@
1
+ # Generated from lib/xlsxrb/elements/workbook.rb with RBS::Inline
2
+
3
+ module Xlsxrb
4
+ module Elements
5
+ # Represents an entire in-memory XLSX workbook.
6
+ #
7
+ # @example Access sheets
8
+ # workbook = Xlsxrb.read("report.xlsx")
9
+ # sheet = workbook.sheet(0) # or workbook["Sheet1"]
10
+ # workbook.each { |s| puts s.name }
11
+ #
12
+ # @api public
13
+ class Workbook < Data
14
+ attr_reader sheets(): untyped
15
+
16
+ attr_reader shared_strings(): untyped
17
+
18
+ attr_reader styles(): untyped
19
+
20
+ attr_reader unmapped_data(): untyped
21
+
22
+ attr_reader errors(): untyped
23
+
24
+ def self.new: (untyped sheets, untyped shared_strings, untyped styles, untyped unmapped_data, untyped errors) -> instance
25
+ | (sheets: untyped, shared_strings: untyped, styles: untyped, unmapped_data: untyped, errors: untyped) -> instance
26
+
27
+ def self.members: () -> [ :sheets, :shared_strings, :styles, :unmapped_data, :errors ]
28
+
29
+ def members: () -> [ :sheets, :shared_strings, :styles, :unmapped_data, :errors ]
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,34 @@
1
+ # Generated from lib/xlsxrb/elements/worksheet.rb with RBS::Inline
2
+
3
+ module Xlsxrb
4
+ module Elements
5
+ # Represents a single worksheet in a workbook.
6
+ #
7
+ # @example Access cells and rows
8
+ # sheet = workbook.sheet(0)
9
+ # cell = sheet["A1"]
10
+ # sheet.each_row { |row| puts row.to_a.inspect }
11
+ #
12
+ # @api public
13
+ class Worksheet < Data
14
+ attr_reader name(): untyped
15
+
16
+ attr_reader rows(): untyped
17
+
18
+ attr_reader columns(): untyped
19
+
20
+ attr_reader charts(): untyped
21
+
22
+ attr_reader unmapped_data(): untyped
23
+
24
+ attr_reader errors(): untyped
25
+
26
+ def self.new: (untyped name, untyped rows, untyped columns, untyped charts, untyped unmapped_data, untyped errors) -> instance
27
+ | (name: untyped, rows: untyped, columns: untyped, charts: untyped, unmapped_data: untyped, errors: untyped) -> instance
28
+
29
+ def self.members: () -> [ :name, :rows, :columns, :charts, :unmapped_data, :errors ]
30
+
31
+ def members: () -> [ :name, :rows, :columns, :charts, :unmapped_data, :errors ]
32
+ end
33
+ end
34
+ end