From 0749d62332d0a80434c0b37638ee51f26997a333 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Wed, 18 Jun 2025 10:27:23 +0900 Subject: [PATCH 1/3] Added gemspec file to gem package The original gemspec need to install rdoc as bundled gems at the official Ruby package. Fix https://bugs.ruby-lang.org/issues/21312 --- rdoc.gemspec | 1 + 1 file changed, 1 insertion(+) diff --git a/rdoc.gemspec b/rdoc.gemspec index 47f48023fc..e6594378ce 100644 --- a/rdoc.gemspec +++ b/rdoc.gemspec @@ -51,6 +51,7 @@ RDoc includes the +rdoc+ and +ri+ tools for generating and displaying documentat "exe/rdoc", "exe/ri", "man/ri.1", + "rdoc.gemspec", ] template_files = Dir.glob("lib/rdoc/generator/template/**/*") lib_files = Dir.glob("lib/**/*.{rb,kpeg,ry}") From e89d2b8853cc3eba409896797bd301de30773886 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Wed, 18 Jun 2025 11:04:20 +0900 Subject: [PATCH 2/3] Use Dir.chdir for the location of gemspec The current glob pattern caused to issue with Ruby package installation. ``` /Users/hsbt/Documents/github.com/ruby/ruby/lib/fileutils.rb:1625:in 'File.stat': No such file or directory @ rb_file_s_stat - /Users/hsbt/Documents/github.com/ruby/ruby/.bundle/gems/rdoc-6.14.0/lib/English.rb (Errno::ENOENT) from /Users/hsbt/Documents/github.com/ruby/ruby/lib/fileutils.rb:1625:in 'block in FileUtils#install' from /Users/hsbt/Documents/github.com/ruby/ruby/lib/fileutils.rb:2471:in 'block in FileUtils#fu_each_src_dest' from /Users/hsbt/Documents/github.com/ruby/ruby/lib/fileutils.rb:2487:in 'FileUtils#fu_each_src_dest0' from /Users/hsbt/Documents/github.com/ruby/ruby/lib/fileutils.rb:2469:in 'FileUtils#fu_each_src_dest' from /Users/hsbt/Documents/github.com/ruby/ruby/lib/fileutils.rb:1624:in 'FileUtils#install' from ./tool/rbinstall.rb:216:in 'Object#install' from ./tool/rbinstall.rb:694:in 'block in RbInstall::DirPackage#extract_files' from ./tool/rbinstall.rb:689:in 'Array#each' from ./tool/rbinstall.rb:689:in 'RbInstall::DirPackage#extract_files' from /Users/hsbt/Documents/github.com/ruby/ruby/lib/rubygems/installer.rb:853:in 'Gem::Installer#extract_files' from /Users/hsbt/Documents/github.com/ruby/ruby/lib/rubygems/installer.rb:312:in 'Gem::Installer#install' from ./tool/rbinstall.rb:746:in 'block in RbInstall::UnpackedInstaller#install' from ./tool/rbinstall.rb:534:in 'RbInstall.no_write' from ./tool/rbinstall.rb:746:in 'RbInstall::UnpackedInstaller#install' from ./tool/rbinstall.rb:1174:in 'block (2 levels) in
' from ./tool/rbinstall.rb:1138:in 'IO.foreach' from ./tool/rbinstall.rb:1138:in 'block in
' from ./tool/rbinstall.rb:1224:in 'block in
' from ./tool/rbinstall.rb:1221:in 'Array#each' from ./tool/rbinstall.rb:1221:in '
' ``` --- rdoc.gemspec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rdoc.gemspec b/rdoc.gemspec index e6594378ce..641dcce46c 100644 --- a/rdoc.gemspec +++ b/rdoc.gemspec @@ -54,7 +54,9 @@ RDoc includes the +rdoc+ and +ri+ tools for generating and displaying documentat "rdoc.gemspec", ] template_files = Dir.glob("lib/rdoc/generator/template/**/*") - lib_files = Dir.glob("lib/**/*.{rb,kpeg,ry}") + lib_files = Dir.chdir(File.expand_path('..', __FILE__)) do + Dir.glob("lib/**/*.{rb,kpeg,ry}") + end s.files = (non_lib_files + template_files + lib_files).uniq From 783adb8ba6a03f219edc36bb618d11ddf8bda159 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Wed, 18 Jun 2025 12:11:05 +0900 Subject: [PATCH 3/3] Use base option with Dir.glob instead of Dir.chdir. Co-authored-by: Sutou Kouhei --- rdoc.gemspec | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rdoc.gemspec b/rdoc.gemspec index 641dcce46c..c3752c9159 100644 --- a/rdoc.gemspec +++ b/rdoc.gemspec @@ -54,9 +54,7 @@ RDoc includes the +rdoc+ and +ri+ tools for generating and displaying documentat "rdoc.gemspec", ] template_files = Dir.glob("lib/rdoc/generator/template/**/*") - lib_files = Dir.chdir(File.expand_path('..', __FILE__)) do - Dir.glob("lib/**/*.{rb,kpeg,ry}") - end + lib_files = Dir.glob("lib/**/*.{rb,kpeg,ry}", base: File.expand_path('..', __FILE__)) s.files = (non_lib_files + template_files + lib_files).uniq