lutaml-model 0.8.107 → 0.8.108
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/json/adapter/yeptris_adapter.rb +11 -0
- data/lib/lutaml/model/configuration.rb +5 -1
- data/lib/lutaml/model/version.rb +1 -1
- data/lib/lutaml/yaml/adapter/yeptris_adapter.rb +11 -0
- data/spec/lutaml/json/yeptris_adapter_spec.rb +3 -10
- data/spec/lutaml/model/adapter_resolver_configured_spec.rb +31 -8
- data/spec/lutaml/yaml/yeptris_adapter_spec.rb +3 -10
- 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: 50f81556cebfd601f3ff6ede463ed9f20d31a0e2c12e8c1362c655b5dd9408e8
|
|
4
|
+
data.tar.gz: c9ec847109db4b87bbb4e4e46fde663eb83d7b9eae54d43f55e1c04024345013
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cbce6698e13f0d52da843a92c4bae8ca69db7f11cdbd654f1dd924cd171f31ad227da0a610557a17de11856de2030460d5b497a248c3b37b7de76ca286398520
|
|
7
|
+
data.tar.gz: d4113a27b55316ad49f5a9263ac3b1d15616c3c7c65408faa1b0a4741ed1966fcd173a8519d85b19dec66a406ce168caf6439703b5e687318ae74dc586ee586d
|
|
@@ -26,6 +26,17 @@ module Lutaml
|
|
|
26
26
|
end
|
|
27
27
|
private_class_method :require_engine
|
|
28
28
|
|
|
29
|
+
# True where the yeptris engine loads (libyeptris present for
|
|
30
|
+
# this platform). Idempotent; a missing or broken install
|
|
31
|
+
# reports false instead of raising, so optional-engine callers
|
|
32
|
+
# can gate on it.
|
|
33
|
+
def self.available?
|
|
34
|
+
require_engine
|
|
35
|
+
true
|
|
36
|
+
rescue LoadError
|
|
37
|
+
false
|
|
38
|
+
end
|
|
39
|
+
|
|
29
40
|
# The parse-error contract is the standard adapter's: invalid
|
|
30
41
|
# input raises JSON::ParserError regardless of the engine, so
|
|
31
42
|
# consumers' rescue ladders (and this gem's own
|
|
@@ -37,7 +37,11 @@ module Lutaml
|
|
|
37
37
|
@conversion_cache = nil
|
|
38
38
|
@configured = false
|
|
39
39
|
@xml_plan_fast_path = true
|
|
40
|
-
|
|
40
|
+
# Opt-in until leptris#1743 lands: the native ordered lane
|
|
41
|
+
# runs away (28+ CPU-min / 14GB RSS on sts-ruby's
|
|
42
|
+
# ISO_13849-1 document) — flipping this on by default regressed
|
|
43
|
+
# the sts bench cell from 4m41s to a 10-minute kill.
|
|
44
|
+
@xml_plan_ordered_path = false
|
|
41
45
|
@element_order_tracking = true
|
|
42
46
|
end
|
|
43
47
|
|
data/lib/lutaml/model/version.rb
CHANGED
|
@@ -40,6 +40,17 @@ module Lutaml
|
|
|
40
40
|
end
|
|
41
41
|
private_class_method :require_engine
|
|
42
42
|
|
|
43
|
+
# True where the yeptris engine loads (libyeptris present for
|
|
44
|
+
# this platform). Idempotent; a missing or broken install
|
|
45
|
+
# reports false instead of raising, so optional-engine callers
|
|
46
|
+
# can gate on it.
|
|
47
|
+
def self.available?
|
|
48
|
+
require_engine
|
|
49
|
+
true
|
|
50
|
+
rescue LoadError
|
|
51
|
+
false
|
|
52
|
+
end
|
|
53
|
+
|
|
43
54
|
# The parse-error contract is the standard adapter's: invalid
|
|
44
55
|
# input raises Psych::SyntaxError regardless of the engine, so
|
|
45
56
|
# consumers' rescue ladders (and this gem's own
|
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require "
|
|
4
|
-
begin
|
|
5
|
-
require "lutaml/json/adapter/yeptris_adapter"
|
|
6
|
-
rescue LoadError
|
|
7
|
-
# yeptris ships no platform gem here (e.g. Windows): every example skips.
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
YEPTRIS_AVAILABLE = defined?(Yeptris)
|
|
3
|
+
require "lutaml/json/adapter/yeptris_adapter"
|
|
11
4
|
|
|
12
|
-
RSpec.describe
|
|
13
|
-
before { skip "yeptris is not available on this platform" unless
|
|
5
|
+
RSpec.describe Lutaml::Json::Adapter::YeptrisAdapter do
|
|
6
|
+
before { skip "yeptris is not available on this platform" unless described_class.available? }
|
|
14
7
|
|
|
15
8
|
let(:attributes) { { "name" => "John", "age" => 30, "roles" => %w[admin dev] } }
|
|
16
9
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require "spec_helper"
|
|
4
|
+
require "open3"
|
|
4
5
|
|
|
5
6
|
RSpec.describe Lutaml::Model::AdapterResolver, ".adapter_for with a configured type" do
|
|
6
7
|
after do
|
|
@@ -22,17 +23,39 @@ RSpec.describe Lutaml::Model::AdapterResolver, ".adapter_for with a configured t
|
|
|
22
23
|
expect(adapter.name).to include("Json::Standard")
|
|
23
24
|
end
|
|
24
25
|
|
|
26
|
+
# Runs in a subprocess: whether the engine is already loaded is a
|
|
27
|
+
# process-global fact, so any in-process assertion would depend on
|
|
28
|
+
# spec file order (the yeptris adapter faces load it).
|
|
25
29
|
it "does not load the optional yeptris engine when a standard adapter is configured" do
|
|
26
|
-
|
|
30
|
+
probe = <<~RUBY
|
|
31
|
+
require "lutaml/model"
|
|
27
32
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
33
|
+
Lutaml::Model::Config.configure do |config|
|
|
34
|
+
config.yaml_adapter_type = :standard
|
|
35
|
+
config.json_adapter_type = :standard
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
adapter_yaml = Lutaml::Model::AdapterResolver.adapter_for(:yaml)
|
|
39
|
+
adapter_json = Lutaml::Model::AdapterResolver.adapter_for(:json)
|
|
32
40
|
|
|
33
|
-
|
|
34
|
-
|
|
41
|
+
# Parsing through the configured adapters must likewise stay on
|
|
42
|
+
# the standard engines.
|
|
43
|
+
adapter_yaml.parse("a: 1")
|
|
44
|
+
adapter_json.parse('{"a":1}')
|
|
45
|
+
|
|
46
|
+
exit(Object.const_defined?(:Yeptris) ? 1 : 0)
|
|
47
|
+
RUBY
|
|
48
|
+
|
|
49
|
+
_stdout, stderr, status = Open3.capture3(RbConfig.ruby, "-I", "lib", "-e", probe)
|
|
50
|
+
expect(status).to be_success, stderr
|
|
51
|
+
end
|
|
52
|
+
end
|
|
35
53
|
|
|
36
|
-
|
|
54
|
+
RSpec.describe "plan lane defaults" do
|
|
55
|
+
it "ships the ordered plan lane opt-in until leptris#1743 is fixed" do
|
|
56
|
+
# The native ordered lane runs away on sts-ruby's ISO_13849-1
|
|
57
|
+
# document (leptris#1743): 28+ CPU-min / 14 GB RSS vs 6.36s on the
|
|
58
|
+
# same parse with the lane off. Opt-in until the engine fix ships.
|
|
59
|
+
expect(Lutaml::Model::Config.instance.xml_plan_ordered_path).to be(false)
|
|
37
60
|
end
|
|
38
61
|
end
|
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require "
|
|
4
|
-
begin
|
|
5
|
-
require "lutaml/yaml/adapter/yeptris_adapter"
|
|
6
|
-
rescue LoadError
|
|
7
|
-
# yeptris ships no platform gem here (e.g. Windows): every example skips.
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
YEPTRIS_AVAILABLE = defined?(Yeptris)
|
|
3
|
+
require "lutaml/yaml/adapter/yeptris_adapter"
|
|
11
4
|
|
|
12
|
-
RSpec.describe
|
|
13
|
-
before { skip "yeptris is not available on this platform" unless
|
|
5
|
+
RSpec.describe Lutaml::Yaml::Adapter::YeptrisAdapter do
|
|
6
|
+
before { skip "yeptris is not available on this platform" unless described_class.available? }
|
|
14
7
|
|
|
15
8
|
let(:attributes) { { "name" => "John", "roles" => %w[admin dev] } }
|
|
16
9
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lutaml-model
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.8.
|
|
4
|
+
version: 0.8.108
|
|
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-10-
|
|
11
|
+
date: 2026-10-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: base64
|