svg_conform 0.2.1 → 0.2.2
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/lib/svg_conform/quality_metrics/complexity_metrics.rb +4 -1
- data/lib/svg_conform/quality_metrics/error_breakdown.rb +4 -1
- data/lib/svg_conform/quality_metrics/feature_flags.rb +4 -1
- data/lib/svg_conform/quality_metrics/quality_result.rb +4 -1
- data/lib/svg_conform/quality_metrics/quality_score.rb +4 -1
- data/lib/svg_conform/remediations/namespace_attribute_remediation.rb +3 -1
- data/lib/svg_conform/remediations/namespace_remediation.rb +4 -1
- data/lib/svg_conform/requirements/allowed_elements_requirement.rb +5 -0
- data/lib/svg_conform/version.rb +1 -1
- data/spec/svg_conform/requirements/id_reference_state_spec.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7e8eb5ad65e9d19baccc8d9751bc57a188b24a59c46c6937489ca8dea3e70901
|
|
4
|
+
data.tar.gz: 8b4fe6936b5dfffc1546ca629a1ffc3dde72bc920fbebc5f4059a5508252f471
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5e4862706e6ff92b9730d1362f7687090e9394800c1c95a0aac4f0ea0af428e3b25fafc3944e72a3d32312dcbb3b685a3df610bb3bb34cb85446228c38b9dc70
|
|
7
|
+
data.tar.gz: 30375296565ff91f64b2545ddfb9d9c7459be83b9a25794f773db1c11999ff217642811456eb5369f6cd6fee29d361b6dd74aa06438c08f6aa0bf5137f0a29fe
|
|
@@ -23,7 +23,10 @@ module SvgConform
|
|
|
23
23
|
attribute :has_clip_paths, :boolean, default: false
|
|
24
24
|
attribute :has_external_refs, :boolean, default: false
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
def initialize(**args)
|
|
27
|
+
super(args)
|
|
28
|
+
freeze
|
|
29
|
+
end
|
|
27
30
|
|
|
28
31
|
# Value equality
|
|
29
32
|
def ==(other)
|
|
@@ -82,7 +82,9 @@ module SvgConform
|
|
|
82
82
|
# Array case
|
|
83
83
|
attributes.each do |attr|
|
|
84
84
|
if should_remove_moxml_attribute?(attr, node, removed_namespaces)
|
|
85
|
-
|
|
85
|
+
local_name = attr.respond_to?(:name) ? attr.name : attr.to_s
|
|
86
|
+
ns_prefix = attr.respond_to?(:namespace) && attr.namespace.respond_to?(:prefix) ? attr.namespace.prefix : nil
|
|
87
|
+
attr_name = ns_prefix && !ns_prefix.empty? ? "#{ns_prefix}:#{local_name}" : local_name
|
|
86
88
|
attributes_to_remove << attr_name
|
|
87
89
|
end
|
|
88
90
|
end
|
|
@@ -59,7 +59,10 @@ module SvgConform
|
|
|
59
59
|
|
|
60
60
|
node.attributes.each do |attr_name, attr_value|
|
|
61
61
|
# Handle both string keys and Moxml::Attribute objects
|
|
62
|
-
|
|
62
|
+
local_name = attr_name.respond_to?(:name) ? attr_name.name : attr_name.to_s
|
|
63
|
+
# Include namespace prefix for namespaced attributes (e.g. "custom:id")
|
|
64
|
+
ns_prefix = attr_name.respond_to?(:namespace) && attr_name.namespace.respond_to?(:prefix) ? attr_name.namespace.prefix : nil
|
|
65
|
+
name_str = ns_prefix && !ns_prefix.empty? ? "#{ns_prefix}:#{local_name}" : local_name
|
|
63
66
|
|
|
64
67
|
# For root SVG element, remove xmlns declarations for disallowed namespaces
|
|
65
68
|
if remove_declarations && node.name == "svg" && name_str.start_with?("xmlns:")
|
data/lib/svg_conform/version.rb
CHANGED
|
@@ -34,7 +34,7 @@ RSpec.describe "IdReferenceRequirement" do
|
|
|
34
34
|
|
|
35
35
|
# Verify first validation caught the error
|
|
36
36
|
expect(result1.errors.map(&:message)).to include(
|
|
37
|
-
|
|
37
|
+
include("Reference to undefined ID 'missing_id'"),
|
|
38
38
|
)
|
|
39
39
|
|
|
40
40
|
# Second validation: SVG without reference errors
|
|
@@ -68,7 +68,7 @@ RSpec.describe "IdReferenceRequirement" do
|
|
|
68
68
|
if i.even?
|
|
69
69
|
# Should have error (svg_with_error)
|
|
70
70
|
expect(result.errors.map(&:message)).to include(
|
|
71
|
-
|
|
71
|
+
include("Reference to undefined ID 'missing_id'"),
|
|
72
72
|
)
|
|
73
73
|
else
|
|
74
74
|
# Should NOT have error about missing_id (svg_without_error)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: svg_conform
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-09-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: lutaml-model
|