Skip to content

Commit f3b389a

Browse files
zzaknobu
authored andcommitted
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.
1 parent 77c7da6 commit f3b389a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/rdoc/options.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -565,9 +565,10 @@ def finish
565565

566566
@op_dir ||= 'doc'
567567

568-
@rdoc_include << "." if @rdoc_include.empty?
569568
root = @root.to_s
570-
@rdoc_include << root unless @rdoc_include.include?(root)
569+
if @rdoc_include.empty? || !@rdoc_include.include?(root)
570+
@rdoc_include << root
571+
end
571572

572573
@exclude = self.exclude
573574

lib/rdoc/rdoc.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def error(msg)
119119
# +files+.
120120

121121
def gather_files files
122-
files = ["."] if files.empty?
122+
files = [@options.root.to_s] if files.empty?
123123

124124
file_list = normalized_file_list files, true, @options.exclude
125125

0 commit comments

Comments
 (0)