From 88a8d4793473259b392241f1e2d20d39bd96b214 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 20 Jan 2022 18:34:19 +0000 Subject: use YAML.unsafe_load in Psych 4.x (Ruby 3.1+) Psych 4.x defaults to "nanny mode" to handle untrusted data. This causes breakage with since YAML references (aliases) emitted by dtas-player can't be handled by Psych clients under Ruby 3.1. Since dtas is single user and is a shell designed to run arbitrary code, favor the new YAML.unsafe_load API which behaves like the old YAML.load in Ruby <= 3.0. --- test/test_sink.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/test_sink.rb') diff --git a/test/test_sink.rb b/test/test_sink.rb index 873fb3a..7214da6 100644 --- a/test/test_sink.rb +++ b/test/test_sink.rb @@ -1,4 +1,4 @@ -# Copyright (C) 2013-2020 all contributors +# Copyright (C) all contributors # License: GPL-3.0+ # frozen_string_literal: true require './test/helper' @@ -27,6 +27,6 @@ class TestSink < Testcase def test_inactive_load orig = { "active" => false }.freeze tmp = orig.to_yaml - assert_equal orig, YAML.load(tmp) + assert_equal orig, DTAS.yaml_load(tmp) end end -- cgit v1.2.3-24-ge0c7