From 86575e243eda81a77ce2ede6a39e534eed9a5c3d Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Wed, 15 Jan 2025 12:09:31 +0900 Subject: [PATCH] Use rdoc provided by bundled gems for generating ruby documentation --- common.mk | 4 +++- tool/lib/bundled_gem.rb | 3 ++- tool/rdoc-srcdir | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/common.mk b/common.mk index 116455b21b..9a055aa7be 100644 --- a/common.mk +++ b/common.mk @@ -64,7 +64,7 @@ LIBRUBY_EXTS = ./.libruby-with-ext.time REVISION_H = ./.revision.time PLATFORM_D = $(TIMESTAMPDIR)/.$(PLATFORM_DIR).time ENC_TRANS_D = $(TIMESTAMPDIR)/.enc-trans.time -RDOC = $(XRUBY) "$(tooldir)/rdoc-srcdir" +RDOC = $(XRUBY) "$(tooldir)/rdoc-srcdir" $(srcdir) RDOCOUT = $(EXTOUT)/rdoc HTMLOUT = $(EXTOUT)/html CAPIOUT = doc/capi @@ -676,6 +676,8 @@ do-install-dbg: $(PROGRAM) pre-install-dbg post-install-dbg:: @$(NULLCMD) +srcs-doc: prepare-gems + rdoc: PHONY main srcs-doc @echo Generating RDoc documentation $(Q) $(RDOC) --ri --op "$(RDOCOUT)" $(RDOC_GEN_OPTS) $(RDOCFLAGS) . diff --git a/tool/lib/bundled_gem.rb b/tool/lib/bundled_gem.rb index d870925d05..45e41ac648 100644 --- a/tool/lib/bundled_gem.rb +++ b/tool/lib/bundled_gem.rb @@ -12,7 +12,8 @@ module BundledGem "singleton", # prime "ipaddr", # rinda "forwardable", # prime, rinda - "strscan" # rexml + "strscan", # rexml + "psych" # rdoc ] module_function diff --git a/tool/rdoc-srcdir b/tool/rdoc-srcdir index 03e5171650..a6a3c9ee24 100755 --- a/tool/rdoc-srcdir +++ b/tool/rdoc-srcdir @@ -1,6 +1,7 @@ #!ruby -W0 -$:.unshift(File.expand_path("../lib", __dir__)) +rdoc_path = Dir.glob("#{ARGV[0]}/.bundle/gems/rdoc-*").first +$LOAD_PATH.unshift("#{rdoc_path}/lib") require 'rdoc/rdoc' # Make only the output directory relative to the invoked directory.