From f801dc8a587d5771ce3649f8086ec6418f33e5e0 Mon Sep 17 00:00:00 2001 From: Ronald Tse Date: Wed, 29 Apr 2026 15:16:59 +0800 Subject: [PATCH 1/2] fix: remove global xml_adapter_type override Setting Lutaml::Model::Config.xml_adapter_type globally at require time is a side-effect that affects every other gem sharing the process. This caused hangs in metanorma-ietf where rfcxml sets :nokogiri but unitsml silently switches to :ox, breaking subsequent to_xml calls. unitsml uses standard Lutaml::Model::Serializable models and calls to_xml/from_xml on them -- none of this requires a specific adapter. The host application should control the adapter configuration. --- lib/unitsml.rb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/unitsml.rb b/lib/unitsml.rb index a1622ca..0a9c395 100644 --- a/lib/unitsml.rb +++ b/lib/unitsml.rb @@ -32,7 +32,3 @@ def parse(string) Unitsml::Parser.new(string).parse end end - -Lutaml::Model::Config.configure do |config| - config.xml_adapter_type = RUBY_ENGINE == "opal" ? :oga : :ox -end From 8962c5946afff7d002e0d22387bfba95862b3655 Mon Sep 17 00:00:00 2001 From: Ronald Tse Date: Wed, 29 Apr 2026 17:20:54 +0800 Subject: [PATCH 2/2] chore: add ox as explicit runtime dependency Ensures an XML adapter is always available for lutaml-model's auto-detection, without needing to set the global adapter type. --- unitsml.gemspec | 1 + 1 file changed, 1 insertion(+) diff --git a/unitsml.gemspec b/unitsml.gemspec index 10d2f34..6bd97f3 100644 --- a/unitsml.gemspec +++ b/unitsml.gemspec @@ -33,6 +33,7 @@ Gem::Specification.new do |spec| spec.require_paths = ["lib"] spec.add_dependency "htmlentities" + spec.add_dependency "ox" spec.add_dependency "lutaml-model", "~> 0.8.0" spec.add_dependency "mml", "~> 2.3.6" spec.add_dependency "parslet"