From 8b2884c0b51e4733c09ecbb388ca1b236bad738b Mon Sep 17 00:00:00 2001 From: zzak Date: Sat, 4 Mar 2023 22:24:01 +0900 Subject: [ruby/rdoc] Isolate root dir if specified This ensures only files from the root directory are chosen, in order to allow a clean build from outside the source directory. https://github.com/ruby/rdoc/commit/f3b389aa9e --- lib/rdoc/options.rb | 5 +++-- lib/rdoc/rdoc.rb | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/rdoc/options.rb b/lib/rdoc/options.rb index eed0f6b39b..6ee29fd071 100644 --- a/lib/rdoc/options.rb +++ b/lib/rdoc/options.rb @@ -565,9 +565,10 @@ class RDoc::Options @op_dir ||= 'doc' - @rdoc_include << "." if @rdoc_include.empty? root = @root.to_s - @rdoc_include << root unless @rdoc_include.include?(root) + if @rdoc_include.empty? || !@rdoc_include.include?(root) + @rdoc_include << root + end @exclude = self.exclude diff --git a/lib/rdoc/rdoc.rb b/lib/rdoc/rdoc.rb index 7e17b71d6b..2da6d9b575 100644 --- a/lib/rdoc/rdoc.rb +++ b/lib/rdoc/rdoc.rb @@ -119,7 +119,7 @@ class RDoc::RDoc # +files+. def gather_files files - files = ["."] if files.empty? + files = [@options.root.to_s] if files.empty? file_list = normalized_file_list files, true, @options.exclude -- cgit v1.2.1