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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4a72cb3f56ae5e29135bdd7842172d4c3bc187e66a63828da8f698d11b1c6e10
4
- data.tar.gz: c5e410dc1cfbade92c7508245333a97cf8622c8803220b8aa0053ff422d14293
3
+ metadata.gz: 8e786faa427ee58eeb9f9dcf52685d2f777ccbb74933329773256a3c37ddaa26
4
+ data.tar.gz: a72d4e6d1d6746bd40d43366b1439c51f99e25c623a5558e8de40e19cf9ec37d
5
5
  SHA512:
6
- metadata.gz: 605a1be485a4c239615849214699268f27d444577ef725c1c784f69ad8957eb46310a9fdd556673fcabc20ac56752128172bbb22d0ac47d2013f4c0e777d3604
7
- data.tar.gz: b42c5f16e33900a164f7ce3cd8f9297789410cb8ce427264d1fbca8b196a206aa8749819fc3dbf8fd9e07864635a891f43effec2e7c32219f066d5add114abd9
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].to_s))
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].to_s), condition: dict[:cond])
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 }
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Lutaml
4
4
  module Path
5
- VERSION = "0.2.2"
5
+ VERSION = "0.2.3"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lutaml-path
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.