lutaml-path 0.2.2 → 0.2.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 +4 -4
- data/lib/lutaml/path/transformer.rb +15 -2
- data/lib/lutaml/path/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8e786faa427ee58eeb9f9dcf52685d2f777ccbb74933329773256a3c37ddaa26
|
|
4
|
+
data.tar.gz: a72d4e6d1d6746bd40d43366b1439c51f99e25c623a5558e8de40e19cf9ec37d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2b04e70ae8817a53590387a721bd0b98768b137c6e8ebcbfa5e5c00c8068f7fb73400ee0159877d6468c6ebf8fb7c727a4a210fbc935ce99cf8034dbeea9ab60
|
|
7
|
+
data.tar.gz: 0e2b4b3379e8cdf975698bd154b28c01dd3320e3bb2e83204d261549d212667ab519290b61587c3525de1a623725944dc74704d0d35ae6c912fe8d47de153cd7
|
|
@@ -51,12 +51,25 @@ module Lutaml
|
|
|
51
51
|
# and a leaf cannot know whether the whole path has dot-steps or filters,
|
|
52
52
|
# so the root rule -- the only place that knows -- decides the type and
|
|
53
53
|
# unwraps Step -> PathSegment when it picks ElementPath.
|
|
54
|
+
#
|
|
55
|
+
# parsanol hands captured leaves back as binary-tagged strings, which
|
|
56
|
+
# raises ArgumentError (invalid byte sequence) at the first downstream
|
|
57
|
+
# regex on non-ASCII input. The boundary re-tag fixes mistagged-valid
|
|
58
|
+
# captures; byte loss inside a multibyte character is a parsanol defect
|
|
59
|
+
# (parsanol/parsanol-ruby#410) and scrubs to replacement content until
|
|
60
|
+
# it ships. Rule blocks run under the transform engine's self, so the
|
|
61
|
+
# helper is a class method.
|
|
62
|
+
def self.utf8(content)
|
|
63
|
+
content.to_s.dup.force_encoding("UTF-8").scrub
|
|
64
|
+
end
|
|
65
|
+
|
|
54
66
|
rule(content: simple(:content)) do |dict|
|
|
55
|
-
Step.new(PathSegment.new(dict[:content]
|
|
67
|
+
Step.new(PathSegment.new(Transformer.utf8(dict[:content])))
|
|
56
68
|
end
|
|
57
69
|
|
|
58
70
|
rule(content: simple(:content), condition: subtree(:cond)) do |dict|
|
|
59
|
-
Step.new(PathSegment.new(dict[:content]
|
|
71
|
+
Step.new(PathSegment.new(Transformer.utf8(dict[:content])),
|
|
72
|
+
condition: dict[:cond])
|
|
60
73
|
end
|
|
61
74
|
|
|
62
75
|
rule(segment: subtree(:segment)) { segment }
|
data/lib/lutaml/path/version.rb
CHANGED