Use rdoc provided by bundled gems for generating ruby documentation

This commit is contained in:
Hiroshi SHIBATA 2025-01-15 12:09:31 +09:00
parent 86d871d29c
commit 86575e243e
Notes: git 2025-01-15 07:53:19 +00:00
3 changed files with 7 additions and 3 deletions

View File

@ -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) .

View File

@ -12,7 +12,8 @@ module BundledGem
"singleton", # prime
"ipaddr", # rinda
"forwardable", # prime, rinda
"strscan" # rexml
"strscan", # rexml
"psych" # rdoc
]
module_function

View File

@ -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.