summaryrefslogtreecommitdiff
path: root/lib/rdoc/options.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rdoc/options.rb')
-rw-r--r--lib/rdoc/options.rb24
1 files changed, 16 insertions, 8 deletions
diff --git a/lib/rdoc/options.rb b/lib/rdoc/options.rb
index 99d7aaaec1..801a84b21f 100644
--- a/lib/rdoc/options.rb
+++ b/lib/rdoc/options.rb
@@ -164,7 +164,7 @@ class RDoc::Options
##
# Files matching this pattern will be excluded
- attr_accessor :exclude
+ attr_writer :exclude
##
# The list of files to be processed
@@ -494,6 +494,20 @@ class RDoc::Options
end
##
+ # Create a regexp for #exclude
+
+ def exclude
+ if @exclude.nil? or Regexp === @exclude then
+ # done, #finish is being re-run
+ @exclude
+ elsif @exclude.empty? then
+ nil
+ else
+ Regexp.new(@exclude.join("|"))
+ end
+ end
+
+ ##
# Completes any unfinished option setup business such as filtering for
# existent files, creating a regexp for #exclude and setting a default
# #template.
@@ -505,13 +519,7 @@ class RDoc::Options
root = @root.to_s
@rdoc_include << root unless @rdoc_include.include?(root)
- if @exclude.nil? or Regexp === @exclude then
- # done, #finish is being re-run
- elsif @exclude.empty? then
- @exclude = nil
- else
- @exclude = Regexp.new(@exclude.join("|"))
- end
+ @exclude = self.exclude
finish_page_dir