Control: tags 1019618 + patch
Control: tags 1019618 + pending

Dear maintainer,

I've prepared an NMU for ruby-delayed-job (versioned as 4.1.9-1.1) and 
uploaded it to DELAYED/15. Please feel free to tell me if I should 
cancel it.

cu
Adrian
diff -Nru ruby-delayed-job-4.1.9/debian/changelog ruby-delayed-job-4.1.9/debian/changelog
--- ruby-delayed-job-4.1.9/debian/changelog	2021-11-22 00:53:24.000000000 +0200
+++ ruby-delayed-job-4.1.9/debian/changelog	2022-10-15 17:07:57.000000000 +0300
@@ -1,3 +1,10 @@
+ruby-delayed-job (4.1.9-1.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Backport upstream fix for Ruby 3.1. (Closes: #1019618)
+
+ -- Adrian Bunk <b...@debian.org>  Sat, 15 Oct 2022 17:07:57 +0300
+
 ruby-delayed-job (4.1.9-1) unstable; urgency=medium
 
   * Team upload.
diff -Nru ruby-delayed-job-4.1.9/debian/patches/0001-Fix-a-broken-spec-due-to-Psych-4.patch ruby-delayed-job-4.1.9/debian/patches/0001-Fix-a-broken-spec-due-to-Psych-4.patch
--- ruby-delayed-job-4.1.9/debian/patches/0001-Fix-a-broken-spec-due-to-Psych-4.patch	1970-01-01 02:00:00.000000000 +0200
+++ ruby-delayed-job-4.1.9/debian/patches/0001-Fix-a-broken-spec-due-to-Psych-4.patch	2022-10-15 17:07:25.000000000 +0300
@@ -0,0 +1,43 @@
+From 80864629c1cd452a8eafa85e2ad69d6285f37c33 Mon Sep 17 00:00:00 2001
+From: willnet <netwill...@gmail.com>
+Date: Mon, 25 Oct 2021 17:22:54 +0900
+Subject: Fix a broken spec due to Psych >= 4
+
+Since psych4.0, the load method has been safe_load, which causes the following error: YAML#load_dj retains the existing safeYAML support, but uses the version of psych that implements unsafe_load. In YAML#load_dj
+
+```
+  1) YAML autoloads the class of an anonymous struct
+     Failure/Error:
+       expect do
+         yaml = "--- !ruby/struct\nn: 1\n"
+         object = YAML.load(yaml)
+         expect(object).to be_kind_of(Struct)
+         expect(object.n).to eq(1)
+       end.not_to raise_error
+
+       expected no Exception, got #<Psych::DisallowedClass: Tried to load unspecified class: Struct> with backtrace:
+         # (eval):2:in `struct'
+         # ./spec/yaml_ext_spec.rb:28:in `block (3 levels) in <top (required)>'
+         # ./spec/yaml_ext_spec.rb:26:in `block (2 levels) in <top (required)>'
+     # ./spec/yaml_ext_spec.rb:26:in `block (2 levels) in <top (required)>'
+```
+---
+ spec/yaml_ext_spec.rb | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/spec/yaml_ext_spec.rb b/spec/yaml_ext_spec.rb
+index aebb9af..83bceea 100644
+--- a/spec/yaml_ext_spec.rb
++++ b/spec/yaml_ext_spec.rb
+@@ -25,7 +25,7 @@ describe 'YAML' do
+   it 'autoloads the class of an anonymous struct' do
+     expect do
+       yaml = "--- !ruby/struct\nn: 1\n"
+-      object = YAML.load(yaml)
++      object = load_with_delayed_visitor(yaml)
+       expect(object).to be_kind_of(Struct)
+       expect(object.n).to eq(1)
+     end.not_to raise_error
+-- 
+2.30.2
+
diff -Nru ruby-delayed-job-4.1.9/debian/patches/series ruby-delayed-job-4.1.9/debian/patches/series
--- ruby-delayed-job-4.1.9/debian/patches/series	2021-11-22 00:53:24.000000000 +0200
+++ ruby-delayed-job-4.1.9/debian/patches/series	2022-10-15 17:07:56.000000000 +0300
@@ -1 +1,2 @@
 simplecov
+0001-Fix-a-broken-spec-due-to-Psych-4.patch

Reply via email to