summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/rdoc/options.rb10
-rw-r--r--lib/rdoc/rdoc.rb2
2 files changed, 9 insertions, 3 deletions
diff --git a/lib/rdoc/options.rb b/lib/rdoc/options.rb
index 0d99a5438e..62c6dabff0 100644
--- a/lib/rdoc/options.rb
+++ b/lib/rdoc/options.rb
@@ -346,7 +346,7 @@ class Options
@show_all = false
@main_page = nil
@marge = false
- @exclude = nil
+ @exclude = []
@quiet = false
@generator_name = 'html'
@generator = generators[@generator_name]
@@ -386,7 +386,7 @@ class Options
when "--all" then @show_all = true
when "--charset" then @charset = arg
when "--debug" then $DEBUG = true
- when "--exclude" then @exclude = Regexp.new(arg)
+ when "--exclude" then @exclude << Regexp.new(arg)
when "--inline-source" then @inline_source = true
when "--line-numbers" then @include_line_numbers = true
when "--main" then @main_page = arg
@@ -473,6 +473,12 @@ class Options
@rdoc_include << "." if @rdoc_include.empty?
+ if @exclude.empty?
+ @exclude = nil
+ else
+ @exclude = Regexp.new(@exclude.join("|"))
+ end
+
check_files
# If no template was specified, use the default
diff --git a/lib/rdoc/rdoc.rb b/lib/rdoc/rdoc.rb
index 5f477f7fea..d55a40466a 100644
--- a/lib/rdoc/rdoc.rb
+++ b/lib/rdoc/rdoc.rb
@@ -163,12 +163,12 @@ module RDoc
file_list = []
relative_files.each do |rel_file_name|
+ next if options.exclude && options.exclude =~ rel_file_name
case type = File.stat(rel_file_name).ftype
when "file"
file_list << rel_file_name if force_doc || ParserFactory.can_parse(rel_file_name)
when "directory"
next if rel_file_name == "CVS" || rel_file_name == ".svn"
- next if options.exclude && options.exclude =~ rel_file_name
dot_doc = File.join(rel_file_name, DOT_DOC_FILENAME)
if File.file?(dot_doc)
file_list.concat(parse_dot_doc_file(rel_file_name, dot_doc, options))