From 7afbbabae8b8c04b8aecebf560f537a785dd31d2 Mon Sep 17 00:00:00 2001 From: KW Kwan Date: Tue, 14 Jan 2025 13:33:54 +0800 Subject: [PATCH] Fix deprecation warning from Liquid v5.6.x --- lib/metanorma/plugin/lutaml/utils.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/metanorma/plugin/lutaml/utils.rb b/lib/metanorma/plugin/lutaml/utils.rb index 0732b0c..8b0e16a 100644 --- a/lib/metanorma/plugin/lutaml/utils.rb +++ b/lib/metanorma/plugin/lutaml/utils.rb @@ -4,7 +4,12 @@ require "metanorma/plugin/lutaml/liquid/custom_filters" require "metanorma/plugin/lutaml/liquid/multiply_local_file_system" -::Liquid::Template.register_filter(Metanorma::Plugin::Lutaml::Liquid::CustomFilters) +liquid_klass = if Object.const_defined?("Liquid::Environment") + Object.const_get("Liquid::Environment").default + else + Object.const_get("Liquid::Template") + end +liquid_klass.register_filter(Metanorma::Plugin::Lutaml::Liquid::CustomFilters) module Metanorma module Plugin