diff options
author | Sven Riedel <sriedel@users.noreply.github.com> | 2022-11-28 05:36:26 +0100 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2022-11-28 04:36:29 +0000 |
commit | e0901f46b7c62acb2cbc9b05ee5753baeb37b82d (patch) | |
tree | fd64532fc736c13d81d487e7f941a323c7b40769 /lib/rdoc/rdoc.rb | |
parent | 745dcf5326ea2c8e2047a3bddeb0fbb7e7d07649 (diff) |
[ruby/rdoc] Add `--no-skipping-tests` option
https://github.com/ruby/rdoc/commit/33925f885f
Diffstat (limited to 'lib/rdoc/rdoc.rb')
-rw-r--r-- | lib/rdoc/rdoc.rb | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/rdoc/rdoc.rb b/lib/rdoc/rdoc.rb index 400f9b5bc3..2d8a9dea8c 100644 --- a/lib/rdoc/rdoc.rb +++ b/lib/rdoc/rdoc.rb @@ -36,6 +36,17 @@ class RDoc::RDoc GENERATORS = {} ## + # List of directory names always skipped + + UNCONDITIONALLY_SKIPPED_DIRECTORIES = %w[CVS .svn .git].freeze + + ## + # List of directory names skipped if test suites should be skipped + + TEST_SUITE_DIRECTORY_NAMES = %w[spec test].freeze + + + ## # Generator instance used for creating output attr_accessor :generator @@ -280,7 +291,10 @@ option) file_list[rel_file_name] = mtime end when "directory" then - next if rel_file_name == "CVS" || rel_file_name == ".svn" + next if UNCONDITIONALLY_SKIPPED_DIRECTORIES.include?(rel_file_name) + + basename = File.basename(rel_file_name) + next if options.skip_tests && TEST_SUITE_DIRECTORY_NAMES.include?(basename) created_rid = File.join rel_file_name, "created.rid" next if File.file? created_rid |