diff --git a/lib/rdoc/options.rb b/lib/rdoc/options.rb index 801a84b21f..53cc3af63c 100644 --- a/lib/rdoc/options.rb +++ b/lib/rdoc/options.rb @@ -344,7 +344,10 @@ def initialize # :nodoc: def init_ivars # :nodoc: @dry_run = false - @exclude = [] + @exclude = %w[ + ~\z \.orig\z \.rej\z \.bak\z + \.gemspec\z + ] @files = nil @force_output = false @force_update = true diff --git a/test/test_rdoc_options.rb b/test/test_rdoc_options.rb index baef2d860e..b6769d14b3 100644 --- a/test/test_rdoc_options.rb +++ b/test/test_rdoc_options.rb @@ -66,7 +66,7 @@ class << coder; alias add []=; end expected = { 'charset' => 'UTF-8', 'encoding' => encoding, - 'exclude' => [], + 'exclude' => %w[~\z \.orig\z \.rej\z \.bak\z \.gemspec\z], 'hyperlink_all' => false, 'line_numbers' => false, 'locale' => nil,