lutaml-model 0.8.161 → 0.8.162

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: 40f892c8db0278f7a1dd5b88220134e6c42f0c14fa5371073ebd416be45f63d1
4
- data.tar.gz: 00ddc4bdb2656c805708036ac712a82375add79b1b93286f08d24ff34d526944
3
+ metadata.gz: 333f71c814c51af046e9e0cfa68eb93dabe046153a74a94ff586ccea9696afae
4
+ data.tar.gz: 52e12f6ec98df9bc559029651bf83334297010a2cd772a1cb4611576bb78ba39
5
5
  SHA512:
6
- metadata.gz: caa94d3c42642ad8e70569b85170b452e45323fd7411cb61594d5b185e772ae387d7d799835ac0250f6efa26666caf6bbb92c60cd1edb9ecd6eadaf5fce29cf2
7
- data.tar.gz: 36ab095bed9f7ef4b83679641f0ce47c98fe6b9517a3aa5e0a5ec0f8db7208a532e03e339ca9e8ba0dcd2759933c2232787080de69aa848031b6be2ce47ab897
6
+ metadata.gz: 3b2dc878baca82c5de267022e628297de2148bbf5546c9c377ab102d2f31c412f44c688096e4799acaf731a15ef1af4418edb3cfb7ae50d4797d62331eb7ffa8
7
+ data.tar.gz: a172603c20219fa5db6c5c5ed54088a4dd9903143d00e9ab8a58a24b806cafbf271f504d286c4db1690a66d11418b2c0e81f283e982ee3e17e41306b09a231be
@@ -416,23 +416,35 @@ module Lutaml
416
416
  end
417
417
 
418
418
  # Native key-value engine preference: yeptris (libyeptris C11)
419
- # when its gem is in the bundle AND the native engine answers a
420
- # probe, else the format's standard adapter. Opt-in by bundle
421
- # contents — nothing is required of consumers that do not add
422
- # yeptris. The probe matters because a half-initialized Yeptris
423
- # constant (the poison-process state the gem documents) passes
424
- # const_defined? and require while every parse fails; without
425
- # it the lane selection flips with process load order and the
426
- # failure surfaces as a native parse error on valid input
427
- # instead of a clean standard-lane parse (#978).
419
+ # when the host explicitly opts in with FONTIST_YAML=yeptris
420
+ # (the switch fontist and lutaml-store share) and the native
421
+ # engine answers a probe, else the format's standard adapter.
422
+ # Detection used to flip the lane for any process whose bundle
423
+ # merely contained yeptris — typically through a transitive
424
+ # dependency — which silently switched YAML parsing and dumping
425
+ # (including line-wrap behavior) for hosts that never chose the
426
+ # engine, and the yeptris YAML build still mis-parses some plain
427
+ # scalars as single-element Arrays on several platforms
428
+ # (leptris/yeptris#863), so bundle-presence selection is not a
429
+ # safe default. The probe matters because a half-initialized
430
+ # Yeptris constant (the poison-process state the gem documents)
431
+ # passes const_defined? and require while every parse fails;
432
+ # without it the lane selection flips with process load order
433
+ # and the failure surfaces as a native parse error on valid
434
+ # input instead of a clean standard-lane parse (#978).
428
435
  def detect_yeptris_kv_adapter(format)
429
436
  default = metadata.dig(format, :default)
430
437
  return default if Lutaml::Model.opal?
438
+ return default unless yeptris_opted_in?
431
439
  return default unless Utils.safe_load("yeptris", :Yeptris)
432
440
 
433
441
  load_adapter(format, :yeptris).available? ? :yeptris : default
434
442
  end
435
443
 
444
+ def yeptris_opted_in?
445
+ ENV["FONTIST_YAML"] == "yeptris"
446
+ end
447
+
436
448
  # Detect available XML adapter.
437
449
  #
438
450
  # Delegates to moxml which is the authority on XML adapter
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Lutaml
4
4
  module Model
5
- VERSION = "0.8.161"
5
+ VERSION = "0.8.162"
6
6
  end
7
7
  end
@@ -24,7 +24,7 @@ RSpec.describe "yeptris adapter error parity" do
24
24
  nil
25
25
  end
26
26
  args = libs.flat_map { |l| ["-I", l] } + ["-e", probe]
27
- Open3.capture2e(Gem.ruby, *args).first
27
+ Open3.capture2e({ "FONTIST_YAML" => "yeptris" }, Gem.ruby, *args).first
28
28
  end
29
29
 
30
30
  def yeptris_installed?
@@ -47,7 +47,9 @@ RSpec.describe Lutaml::Model::AdapterResolver, ".adapter_for yeptris native dete
47
47
  it "resolves the yeptris lane when the native engine answers a probe" do
48
48
  skip "optional yeptris engine not resolvable outside the bundle" unless subprocess_yeptris_capable?
49
49
 
50
- stdout, stderr, status = Open3.capture3(RbConfig.ruby, "-I", "lib", "-e", parse_probe)
50
+ stdout, stderr, status = Open3.capture3({ "FONTIST_YAML" => "yeptris" },
51
+ RbConfig.ruby, "-I", "lib", "-e",
52
+ parse_probe)
51
53
  expect(status).to be_success, stderr
52
54
  expect(stdout).to include("ADAPTER=YeptrisAdapter")
53
55
  expect(stdout).to include("PARSED=scalar")
@@ -69,7 +71,9 @@ RSpec.describe Lutaml::Model::AdapterResolver, ".adapter_for yeptris native dete
69
71
  #{parse_probe}
70
72
  RUBY
71
73
 
72
- stdout, stderr, status = Open3.capture3(RbConfig.ruby, "-I", "lib", "-e", poison)
74
+ stdout, stderr, status = Open3.capture3({ "FONTIST_YAML" => "yeptris" },
75
+ RbConfig.ruby, "-I", "lib", "-e",
76
+ poison)
73
77
  expect(status).to be_success, stderr
74
78
  expect(stdout).to include("ADAPTER=StandardAdapter")
75
79
  expect(stdout).to include("PARSED=scalar")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lutaml-model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.161
4
+ version: 0.8.162
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.