Fix rdoc error when installing multiple document kinds.

Sourced from Fedora: https://src.fedoraproject.org/rpms/rubygem-rdoc/pull-request/3
and deleted the portion of the patch that edited the rdoc's tests, because the upstream
Ruby tar does not contain tests for rdoc.

Fixes case where installling multiple documents: `gem install -V hocon --document=ri,rdoc`
can result in an exception:
~~~
$ gem install -V hocon --document=ri,rdoc
....
....
Successfully installed hocon-1.4.0
Parsing documentation for hocon-1.4.0
Parsing sources...
100% [88/88]  lib/hocon/version.rb
Installing ri documentation for hocon-1.4.0
Installing aliki documentation for hocon-1.4.0
ERROR:  While executing gem ... (NoMethodError)
    undefined method 'empty?' for an instance of RDoc::Markup::Paragraph

    return '' unless first_comment && !first_comment.empty?
                                                    ^^^^^^^
<...snip...>
~~~
See: https://github.com/ruby/rdoc/issues/1530
This commit is contained in:
Jarek Prokop 2026-01-07 10:32:32 +01:00
commit 916dd3e4c2
2 changed files with 32 additions and 0 deletions

View file

@ -295,6 +295,9 @@ Patch7: ruby-3.3.0-Disable-syntax-suggest-test-case.patch
# Add a way to provide %%build_rustflags to JIT's rustc.
# https://github.com/ruby/ruby/pull/15695
Patch8: ruby-4.0.1-Support-customizable-rustc_flags-for-rustc-builds.patch
# https://github.com/ruby/rdoc/pull/1531
# Fix error with `gem install --document=rdoc,ri`
Patch9: rdoc-pr1531-fix-mutilple-document-installation.patch
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%{?with_rubypick:Suggests: rubypick}
@ -797,6 +800,7 @@ analysis result in RBS format, a standard type description format for Ruby
pushd .bundle/gems/rdoc-%{rdoc_version}
%patch 1 -p1
%patch 9 -p1
popd
%patch 2 -p1