emfsvg 0.1.2 → 0.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5486d21c06edc95e8adcdd149befbac957e05eb18b3d4cb89a6ac556cf991f68
4
- data.tar.gz: 423352d0507ab33950c3dbe22cfba957e76af5f48961dd77ab782b58714eaf75
3
+ metadata.gz: fa10edb2ac2c6602479c03f38b672f394d9c99025093d7a5665346917bab956d
4
+ data.tar.gz: 1e18ecea04a50531708768fe8b92effe7b0babf52e8b284603855185eaafc6ed
5
5
  SHA512:
6
- metadata.gz: 2f2bdd7812cca71e2c160a8cba35a825c523678496db81176ba9f5f09aa0bbe5626e54d38aaaf8562b004c1a601c931a5a224a1c85a69d6ac770abbd617b9323
7
- data.tar.gz: da3a81e8f1a56e7e213c25cb83621430c1f242b1b00edbf37d4c41c525ac5dc83b78342f095a2cafdca9fbc972c7625f983e9d4f07f55077eb0d2de9f79f58f6
6
+ metadata.gz: 2ad2f6818aa2e6a0dfcc5cc6010de3e12d92065dd5f3b2ca6a8076e2f4c4b96761568e9a8c504e8ad6d14776247942a1a49db54dcf9387443baf0fa1123fa2c7
7
+ data.tar.gz: 70eb4d34ac8872571de4062150630df64e77e437d88bdfc86d73cf7143cf1efde0f176403cdf1604a6bbb7c49eab1ee7b4ed9bdc38c757976c07c2a1c90ade25
@@ -6,7 +6,7 @@ module Emfsvg
6
6
  # carry typed semantic fields; the base provides a uniform interface
7
7
  # for the translation layer's dispatch.
8
8
  #
9
- # Element instances are immutable: built once from a Nokogiri node
9
+ # Element instances are immutable: built once from a leptris node
10
10
  # via the .from_node factory. The node is not retained.
11
11
  class Element
12
12
  ELEMENT_NAME = "abstract"
@@ -4,7 +4,7 @@ module Emfsvg
4
4
  module Svg
5
5
  # Subclasses of Svg::Element for the supported SVG shape vocabulary.
6
6
  # Each subclass parses its typed attributes at construction time
7
- # (no Nokogiri node is retained). Register in Svg::Element's
7
+ # (no leptris node is retained). Register in Svg::Element's
8
8
  # registry so Svg::Element.from_node dispatches correctly.
9
9
  module Elements
10
10
  autoload :Stylable, "emfsvg/svg/elements/stylable"
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "nokogiri"
3
+ require "leptris"
4
4
 
5
5
  module Emfsvg
6
6
  module Svg
7
7
  # Parses an SVG document string into a Svg::Document value object.
8
- # Nokogiri is the only XML/HTML parser used in this gem.
8
+ # leptris is the only XML parser used in this gem.
9
9
  #
10
10
  # Width/height are coerced to floats (CSS units other than px are
11
11
  # out of scope for v1; a numeric value is treated as user units).
@@ -14,7 +14,11 @@ module Emfsvg
14
14
  module_function
15
15
 
16
16
  def call(string)
17
- doc = Nokogiri::XML(string, &:noblanks)
17
+ doc = begin
18
+ Leptris::XML.parse(string, options: Leptris::XML::ParseOptions.noblanks)
19
+ rescue Leptris::XML::ParseError
20
+ raise ParseError, "not an SVG document: unparseable content"
21
+ end
18
22
  root = doc.root
19
23
  raise ParseError, "not an SVG document: missing root element" unless root
20
24
 
data/lib/emfsvg/svg.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  module Emfsvg
4
4
  # Pure SVG domain model. No EMF knowledge lives here.
5
5
  #
6
- # Svg::Parser consumes a Nokogiri-parsed SVG document and produces
6
+ # Svg::Parser consumes a leptris-parsed SVG document and produces
7
7
  # Svg::Document / Svg::Element value objects. Translation layer
8
8
  # (Emfsvg::Translation) consumes these.
9
9
  module Svg
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Emfsvg
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: emfsvg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-07-26 00:00:00.000000000 Z
11
+ date: 2026-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base64
@@ -81,19 +81,19 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '1.6'
83
83
  - !ruby/object:Gem::Dependency
84
- name: nokogiri
84
+ name: leptris
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '1.16'
89
+ version: 1.9.362
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '1.16'
96
+ version: 1.9.362
97
97
  description: Convert Microsoft Enhanced Metafile (EMF) to SVG and back. Consumes the
98
98
  `emf` gem's domain model. Replaces the FFI wrapper around libemf2svg with a pure-Ruby
99
99
  transformer.