summaryrefslogtreecommitdiff
path: root/lib/rdoc/options.rb
diff options
context:
space:
mode:
authoraycabta <aycabta@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-08 17:39:52 +0000
committeraycabta <aycabta@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-08 17:39:52 +0000
commit18911e99d2960433f4e77e5f6ce28bf187dad5a9 (patch)
tree53e7e346b56da5d75973fa2447b2175ee08b62c8 /lib/rdoc/options.rb
parentf6a38e180e5abc4db445b8e50d698ced71dbea87 (diff)
Merge RDoc 6.1.0.beta3 from upstream
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66286 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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 99d7aaaec15..801a84b21f9 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