summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2024-10-08 23:43:02 +0900
committerNobuyoshi Nakada <[email protected]>2024-10-08 23:43:02 +0900
commit02101f473b6d16d0b6d019442c41724e308f493b (patch)
tree2e495519f3455e941f80871b4b2c62d428b15d56
parent8ba2c3109c0f80f285b8db2fed10d8f5f026c208 (diff)
rdoc-srcdir: Adjust the version number in the title in .rdoc_options
Other command line options are no longer needed usually.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/11832
-rw-r--r--common.mk1
-rwxr-xr-xtool/rdoc-srcdir6
2 files changed, 6 insertions, 1 deletions
diff --git a/common.mk b/common.mk
index de7b553dee..3000a49319 100644
--- a/common.mk
+++ b/common.mk
@@ -70,7 +70,6 @@ HTMLOUT = $(EXTOUT)/html
CAPIOUT = doc/capi
INSTALL_DOC_OPTS = --rdoc-output="$(RDOCOUT)" --html-output="$(HTMLOUT)"
RDOC_GEN_OPTS = --no-force-update \
- --title "Documentation for Ruby $(RUBY_API_VERSION)" \
$(empty)
INITOBJS = dmyext.$(OBJEXT) dmyenc.$(OBJEXT)
diff --git a/tool/rdoc-srcdir b/tool/rdoc-srcdir
index 10c63caf9e..304deb67ce 100755
--- a/tool/rdoc-srcdir
+++ b/tool/rdoc-srcdir
@@ -9,6 +9,12 @@ invoked = Dir.pwd
Dir.chdir(File.dirname(__dir__))
options = RDoc::Options.load_options
+options.title = options.title.sub(/Ruby \K.*version/) {
+ File.read("include/ruby/version.h")
+ .scan(/^ *# *define +RUBY_API_VERSION_(MAJOR|MINOR) +(\d+)/)
+ .sort # "MAJOR" < "MINOR", fortunately
+ .to_h.values.join(".")
+}
options.parse ARGV
options.singleton_class.define_method(:finish) do