ruby_pptx 0.1.0 → 0.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.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +98 -0
  3. data/README.md +94 -4
  4. data/lib/ruby_pptx/action.rb +12 -4
  5. data/lib/ruby_pptx/autoshape_spec.rb +6 -2
  6. data/lib/ruby_pptx/builder.rb +3 -1
  7. data/lib/ruby_pptx/chart/categories.rb +45 -15
  8. data/lib/ruby_pptx/chart/chart.rb +168 -31
  9. data/lib/ruby_pptx/chart/combo.rb +19 -4
  10. data/lib/ruby_pptx/chart/data.rb +45 -15
  11. data/lib/ruby_pptx/chart/format.rb +229 -76
  12. data/lib/ruby_pptx/chart/workbook_writer.rb +9 -3
  13. data/lib/ruby_pptx/chart/xml_writer.rb +54 -18
  14. data/lib/ruby_pptx/chart/xy_data.rb +68 -22
  15. data/lib/ruby_pptx/dml/color.rb +27 -9
  16. data/lib/ruby_pptx/dml/effect.rb +6 -2
  17. data/lib/ruby_pptx/dml/fill.rb +42 -14
  18. data/lib/ruby_pptx/element_proxy.rb +12 -4
  19. data/lib/ruby_pptx/enum/base.rb +30 -10
  20. data/lib/ruby_pptx/enum/prog_id.rb +3 -1
  21. data/lib/ruby_pptx/geometry.rb +32 -10
  22. data/lib/ruby_pptx/image.rb +27 -9
  23. data/lib/ruby_pptx/length.rb +94 -27
  24. data/lib/ruby_pptx/media.rb +12 -4
  25. data/lib/ruby_pptx/numeric_lengths.rb +34 -9
  26. data/lib/ruby_pptx/opc/oxml.rb +7 -5
  27. data/lib/ruby_pptx/opc/pack_uri.rb +15 -5
  28. data/lib/ruby_pptx/opc/package.rb +97 -31
  29. data/lib/ruby_pptx/opc/serialized.rb +15 -5
  30. data/lib/ruby_pptx/oxml/backend.rb +585 -0
  31. data/lib/ruby_pptx/oxml/chart.rb +112 -42
  32. data/lib/ruby_pptx/oxml/content_model.rb +6 -2
  33. data/lib/ruby_pptx/oxml/dml/color.rb +6 -2
  34. data/lib/ruby_pptx/oxml/dml/fill.rb +6 -2
  35. data/lib/ruby_pptx/oxml/element.rb +138 -101
  36. data/lib/ruby_pptx/oxml/ns.rb +7 -7
  37. data/lib/ruby_pptx/oxml/presentation.rb +9 -3
  38. data/lib/ruby_pptx/oxml/section.rb +3 -1
  39. data/lib/ruby_pptx/oxml/shapes/autoshape.rb +39 -13
  40. data/lib/ruby_pptx/oxml/shapes/groupshape.rb +15 -7
  41. data/lib/ruby_pptx/oxml/shapes/other.rb +47 -16
  42. data/lib/ruby_pptx/oxml/shapes/shared.rb +96 -30
  43. data/lib/ruby_pptx/oxml/simple_types.rb +169 -52
  44. data/lib/ruby_pptx/oxml/slide.rb +25 -8
  45. data/lib/ruby_pptx/oxml/table.rb +39 -13
  46. data/lib/ruby_pptx/oxml/text.rb +122 -16
  47. data/lib/ruby_pptx/oxml/theme.rb +13 -4
  48. data/lib/ruby_pptx/package.rb +9 -3
  49. data/lib/ruby_pptx/parts/chart.rb +6 -2
  50. data/lib/ruby_pptx/parts/image.rb +12 -4
  51. data/lib/ruby_pptx/parts/media.rb +3 -1
  52. data/lib/ruby_pptx/parts/presentation.rb +15 -5
  53. data/lib/ruby_pptx/parts/slide.rb +33 -11
  54. data/lib/ruby_pptx/parts/theme.rb +3 -1
  55. data/lib/ruby_pptx/pattern_matching.rb +6 -2
  56. data/lib/ruby_pptx/presentation.rb +24 -8
  57. data/lib/ruby_pptx/section.rb +30 -10
  58. data/lib/ruby_pptx/shapes/adjustments.rb +9 -3
  59. data/lib/ruby_pptx/shapes/authoring.rb +3 -1
  60. data/lib/ruby_pptx/shapes/base.rb +74 -24
  61. data/lib/ruby_pptx/shapes/freeform.rb +36 -12
  62. data/lib/ruby_pptx/shapes/placeholder.rb +44 -15
  63. data/lib/ruby_pptx/shapes/shape.rb +91 -30
  64. data/lib/ruby_pptx/shapes/shape_tree.rb +235 -121
  65. data/lib/ruby_pptx/slide.rb +137 -46
  66. data/lib/ruby_pptx/table.rb +105 -35
  67. data/lib/ruby_pptx/text/font_metrics.rb +30 -9
  68. data/lib/ruby_pptx/text/list_style.rb +88 -0
  69. data/lib/ruby_pptx/text/text.rb +241 -59
  70. data/lib/ruby_pptx/theme.rb +30 -10
  71. data/lib/ruby_pptx/version.rb +1 -1
  72. data/lib/ruby_pptx.rb +9 -1
  73. metadata +24 -2
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pptx
4
- VERSION = "0.1.0"
4
+ VERSION = "0.3.0"
5
5
  end
data/lib/ruby_pptx.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "nokogiri"
3
+ # Nokogiri is not required here: Pptx::Oxml::Backend loads it when it can
4
+ # and falls back to REXML when it cannot, as under ruby.wasm.
4
5
  require "zip"
5
6
 
6
7
  require "ruby_pptx/version"
@@ -33,6 +34,7 @@ require "ruby_pptx/dml/effect"
33
34
  require "ruby_pptx/oxml/theme"
34
35
  require "ruby_pptx/theme"
35
36
  require "ruby_pptx/text/text"
37
+ require "ruby_pptx/text/list_style"
36
38
  require "ruby_pptx/text/font_metrics"
37
39
  require "ruby_pptx/text/fitter"
38
40
  require "ruby_pptx/oxml/table"
@@ -87,4 +89,10 @@ require "ruby_pptx/enum/prog_id"
87
89
 
88
90
  # A Ruby object model for PowerPoint (.pptx) files, ported from python-pptx.
89
91
  module Pptx
92
+ # The XML library in use: :nokogiri, or :rexml where Nokogiri cannot be
93
+ # loaded (ruby.wasm) or RUBY_PPTX_XML_BACKEND=rexml asks for it. Output is
94
+ # the same either way; Nokogiri is several times faster.
95
+ def self.xml_backend
96
+ Oxml::BACKEND.name
97
+ end
90
98
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_pptx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-09-28 00:00:00.000000000 Z
11
+ date: 2026-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -24,6 +24,26 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.18'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rexml
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 3.3.9
34
+ - - "<"
35
+ - !ruby/object:Gem::Version
36
+ version: '4'
37
+ type: :runtime
38
+ prerelease: false
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: 3.3.9
44
+ - - "<"
45
+ - !ruby/object:Gem::Version
46
+ version: '4'
27
47
  - !ruby/object:Gem::Dependency
28
48
  name: rubyzip
29
49
  requirement: !ruby/object:Gem::Requirement
@@ -88,6 +108,7 @@ files:
88
108
  - lib/ruby_pptx/opc/serialized.rb
89
109
  - lib/ruby_pptx/opc/spec.rb
90
110
  - lib/ruby_pptx/oxml/action.rb
111
+ - lib/ruby_pptx/oxml/backend.rb
91
112
  - lib/ruby_pptx/oxml/chart.rb
92
113
  - lib/ruby_pptx/oxml/content_model.rb
93
114
  - lib/ruby_pptx/oxml/core_properties.rb
@@ -142,6 +163,7 @@ files:
142
163
  - lib/ruby_pptx/templates/xlsx-icon.emf
143
164
  - lib/ruby_pptx/text/fitter.rb
144
165
  - lib/ruby_pptx/text/font_metrics.rb
166
+ - lib/ruby_pptx/text/list_style.rb
145
167
  - lib/ruby_pptx/text/text.rb
146
168
  - lib/ruby_pptx/theme.rb
147
169
  - lib/ruby_pptx/version.rb