From 51e9074de2ce79a8f906a0dbfd445b9c9726bafd Mon Sep 17 00:00:00 2001 From: Junichi Sato <22004610+sato11@users.noreply.github.com> Date: Fri, 26 Jan 2024 14:28:41 +0900 Subject: [PATCH] Prevent rdoc task from excluding the main page There was a bug where the main page becomes unable to be found and this change ensures that it does not happen. Closes https://github.com/rails/rails/issues/50871. --- railties/lib/rails/api/task.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/railties/lib/rails/api/task.rb b/railties/lib/rails/api/task.rb index ddd7952381..d937c8273c 100644 --- a/railties/lib/rails/api/task.rb +++ b/railties/lib/rails/api/task.rb @@ -146,8 +146,6 @@ def configure_sdoc end def configure_rdoc_files - rdoc_files.include(api_main) - RDOC_FILES.each do |component, cfg| cdr = component_root_dir(component) @@ -172,6 +170,9 @@ def configure_rdoc_files # Nothing to do exit(0) if rdoc_files.empty? end + + # This must come after the mtime comparison to ensure the main page is not excluded. + rdoc_files.include(api_main) end # These variables are used by the sdoc template