Make RDoc soft dependnecy in IRB.

Resolves: rhbz#2119964
This commit is contained in:
Jun Aruga 2022-08-26 14:36:43 +02:00
parent ad7f78b5c8
commit bf921512e2
3 changed files with 78 additions and 0 deletions

View File

@ -0,0 +1,24 @@
From 54c8df06ff9e161012f89d19a4e3aa2e0e37e1b0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
Date: Tue, 23 Aug 2022 10:41:28 +0200
Subject: [PATCH] Drop hard dependency on RDoc.
This has been introduced in 026700499dfd640b2072d7bf0370247a98d5ac40,
but it seems that this is just be mistake, otherwise the later handling
of `LoadError` would not be needed.
---
lib/irb/input-method.rb | 1 -
1 file changed, 1 deletion(-)
diff --git a/lib/irb/input-method.rb b/lib/irb/input-method.rb
index fd68239e..a8227caa 100644
--- a/lib/irb/input-method.rb
+++ b/lib/irb/input-method.rb
@@ -14,7 +14,6 @@
require_relative 'completion'
require 'io/console'
require 'reline'
-require 'rdoc'
module IRB
STDIN_FILE_NAME = "(line)" # :nodoc:

View File

@ -0,0 +1,41 @@
From b24852058fc87c940252c8a711c60ae2eb298082 Mon Sep 17 00:00:00 2001
From: Jun Aruga <jaruga@redhat.com>
Date: Thu, 25 Aug 2022 20:11:34 +0200
Subject: [PATCH] Require RDoc in `input-method.rb` again in a limited scope.
RDoc is implemented as soft dependency in IRB. See how the rdoc is required in
the files. I reverted the commit below.
```
$ grep -ril rdoc lib/
lib/irb/cmd/help.rb
lib/irb/completion.rb
lib/irb/easter-egg.rb
lib/irb/input-method.rb
```
---
Revert "Remove `require` in signal handler to avoid ThreadError"
This reverts commit 5f749c613c895cf1b11b5e4cbd1205363bc58028.
---
lib/irb/input-method.rb | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/lib/irb/input-method.rb b/lib/irb/input-method.rb
index a8227ca..b77fd32 100644
--- a/lib/irb/input-method.rb
+++ b/lib/irb/input-method.rb
@@ -320,6 +320,11 @@ def auto_indent(&block)
[195, 164], # The "ä" that appears when Alt+d is pressed on xterm.
[226, 136, 130] # The "∂" that appears when Alt+d in pressed on iTerm2.
]
+ begin
+ require 'rdoc'
+ rescue LoadError
+ return nil
+ end
if just_cursor_moving and completion_journey_data.nil?
return nil

View File

@ -202,6 +202,12 @@ Patch25: ruby-rubygems-3.3.8-Resolve-cleaned-up-error-with-temporary-gemhome.pat
# Fix tests with Europe/Amsterdam pre-1970 time on tzdata version 2022b.
# https://github.com/ruby/spec/pull/939
Patch26: ruby-spec-Fix-tests-on-tzdata-2022b.patch
# Drop hard dependency on RDoc in IRB.
# https://github.com/ruby/irb/pull/393
Patch27: ruby-irb-1.4.1-drop-rdoc-hard-dep.patch
# Set soft dependency on RDoc in input-method.rb in IRB.
# https://github.com/ruby/irb/pull/395
Patch28: ruby-irb-1.4.1-set-rdoc-soft-dep.patch
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
Suggests: rubypick
@ -354,6 +360,7 @@ Requires: ruby(rubygems) >= %{rubygems_version}
# ruby-default-gems is required to run irb.
# https://bugs.ruby-lang.org/issues/16951
Requires: ruby-default-gems >= %{ruby_version}
Recommends: rubygem(rdoc) >= %{rdoc_version}
Provides: irb = %{version}-%{release}
Provides: rubygem(irb) = %{version}-%{release}
# Obsoleted by Ruby 2.6 in F30 timeframe.
@ -679,6 +686,8 @@ find .bundle/gems -name '*-[0-9]*.gemspec' -exec cp -t .bundle/specifications/ {
%patch24 -p1
%patch25 -p1
%patch26 -p1
%patch27 -p1
%patch28 -p1
# Provide an example of usage of the tapset:
cp -a %{SOURCE3} .
@ -1535,6 +1544,10 @@ mv test/fiddle/test_import.rb{,.disable}
%changelog
* Mon Aug 29 2022 Jun Aruga <jaruga@redhat.com> - 3.1.2-168
- Make RDoc soft dependnecy in IRB.
Resolves: rhbz#2119964
* Wed Aug 24 2022 Jun Aruga <jaruga@redhat.com> - 3.1.2-168
- Fix tests with Europe/Amsterdam pre-1970 time on tzdata version 2022b.
Resolves: rhbz#2120354