[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
This commit is contained in:
zzak 2023-03-04 22:24:01 +09:00 committed by git
parent 40438fc4d3
commit 8b2884c0b5
2 changed files with 4 additions and 3 deletions

View File

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

View File

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