File: 0002-fix-usage-with-Psych-4.patch

package info (click to toggle)
ruby-whitewash 2.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 220 kB
  • sloc: ruby: 1,217; makefile: 3
file content (29 lines) | stat: -rw-r--r-- 784 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From: Daniel Leidert <dleidert@debian.org>
Date: Sat, 28 Jan 2023 17:06:29 +0100
Subject: Fix usage with Psych 4

Since Psych 4 the load() function maps to safe_load(), disallowing to load
Symbols, Dates, Objects, references. This makes samizdat FTBFS.

<https://github.com/ruby/psych/pull/487>

The error message is:

  Psych::DisallowedClass: Tried to load unspecified class <...>.
---
 lib/whitewash.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/whitewash.rb b/lib/whitewash.rb
index fe767f3..8f1f008 100644
--- a/lib/whitewash.rb
+++ b/lib/whitewash.rb
@@ -19,7 +19,7 @@ class Whitewash
 
   if RUBY_VERSION >= '2.0' or RUBY_VERSION < '1.9.3'
     def Whitewash.load(string)
-      YAML.load(string)
+      YAML.unsafe_load(string)
     end
 
   else