diff --git a/0003-support-ruby33-Logger.patch b/0003-support-ruby33-Logger.patch new file mode 100644 index 0000000..eadf945 --- /dev/null +++ b/0003-support-ruby33-Logger.patch @@ -0,0 +1,39 @@ +From 4c93df1eeff84463c6fc299b62b78c20c3163a09 Mon Sep 17 00:00:00 2001 +From: Mamoru TASAKA +Date: Fri, 29 Sep 2023 15:00:12 +0900 +Subject: [PATCH] Support ruby3.3 Logger by properly initialize super class + +Upcoming ruby3.3 will have enhanced Logger class: +https://github.com/ruby/ruby/commit/194520f80e1cdb71faa055d731450855a1ddb8d1 +which initializes newly added instance variables. +Without initializing such variables (in super class), now using +subclass of Logger will cause exception. + +To avoid this, first call super, then execute additional subclass +initialization. + +Closes #4493 . +--- + lib/asciidoctor/logging.rb | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/lib/asciidoctor/logging.rb b/lib/asciidoctor/logging.rb +index 7664c7e75d..1f846c4fba 100644 +--- a/lib/asciidoctor/logging.rb ++++ b/lib/asciidoctor/logging.rb +@@ -42,6 +42,7 @@ class MemoryLogger < ::Logger + attr_reader :messages + + def initialize ++ super nil + self.level = WARN + @messages = [] + end +@@ -69,6 +70,7 @@ class NullLogger < ::Logger + attr_reader :max_severity + + def initialize ++ super nil + self.level = WARN + end + diff --git a/rubygem-asciidoctor.spec b/rubygem-asciidoctor.spec index 5f43a8b..e596361 100644 --- a/rubygem-asciidoctor.spec +++ b/rubygem-asciidoctor.spec @@ -7,7 +7,7 @@ Summary: A fast, open source AsciiDoc implementation in Ruby Name: rubygem-%{gem_name} Version: 2.0.20 -Release: 3%{?dist} +Release: 4%{?dist} License: MIT URL: https://asciidoctor.org Source0: https://github.com/asciidoctor/asciidoctor/archive/%{gittag}/%{gem_name}-%{version}%{pre}.tar.gz @@ -17,6 +17,8 @@ Source0: https://github.com/asciidoctor/asciidoctor/archive/%{gittag}/%{gem_name Patch0: 0001-use-single-line-block-in-manify-method-in-manpage-co.patch # https://github.com/asciidoctor/asciidoctor/commit/b7c03964 Patch1: 0002-change-dot-layout-in-chained-method-call-to-be-compa.patch +# https://github.com/asciidoctor/asciidoctor/pull/4494 +Patch2: 0003-support-ruby33-Logger.patch %if 0%{?el7} Requires: ruby(release) BuildRequires: ruby(release) @@ -127,6 +129,9 @@ cp -a .%{gem_instdir}/man/*.1 \ %doc %{gem_docdir} %changelog +* Fri Sep 29 2023 Mamoru TASAKA - 2.0.20-4 +- Apply the upstream PR to support ruby 3.3 Logger + * Fri Jul 21 2023 Fedora Release Engineering - 2.0.20-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild