diff options
author | zzak <zzakscott@gmail.com> | 2023-02-01 12:22:23 +0900 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2023-02-03 23:41:06 +0000 |
commit | e04d20bc482e39262a648e71193c1739b5a702fc (patch) | |
tree | cc475443ce6ff061714d5d606115d5f64e4541a4 /lib/rdoc | |
parent | a8000d06cc718349192acbc8343ba849ba34a67f (diff) | |
download | ruby-e04d20bc482e39262a648e71193c1739b5a702fc.tar.gz |
[ruby/rdoc] Add rdoc:coverage default task
https://github.com/ruby/rdoc/commit/157fbaf575
Diffstat (limited to 'lib/rdoc')
-rw-r--r-- | lib/rdoc/task.rb | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/lib/rdoc/task.rb b/lib/rdoc/task.rb index 8ea2d0588c..72b5111ff6 100644 --- a/lib/rdoc/task.rb +++ b/lib/rdoc/task.rb @@ -50,6 +50,9 @@ require 'rake/tasklib' # [rerdoc] # Rebuild the rdoc files from scratch, even if they are not out of date. # +# [rdoc:coverage] +# Print RDoc coverage report for all rdoc files. +# # Simple Example: # # require 'rdoc/task' @@ -90,8 +93,8 @@ require 'rake/tasklib' # RDoc::Task.new(:rdoc => "rdoc", :clobber_rdoc => "rdoc:clean", # :rerdoc => "rdoc:force") # -# This will create the tasks <tt>:rdoc</tt>, <tt>:rdoc:clean</tt> and -# <tt>:rdoc:force</tt>. +# This will create the tasks <tt>:rdoc</tt>, <tt>:rdoc:clean</tt>, +# <tt>:rdoc:force</tt>, and <tt>:rdoc:coverage</tt>. class RDoc::Task < Rake::TaskLib @@ -248,6 +251,16 @@ class RDoc::Task < Rake::TaskLib RDoc::RDoc.new.document args end + namespace rdoc_task_name do + desc coverage_task_description + task coverage_task_name do + @before_running_rdoc.call if @before_running_rdoc + opts = option_list << "-C" + args = opts + @rdoc_files + + $stderr.puts "rdoc #{args.join ' '}" if Rake.application.options.trace + end + end self end @@ -288,6 +301,13 @@ class RDoc::Task < Rake::TaskLib "Rebuild RDoc HTML files" end + ## + # Task description for the coverage task or its renamed description + + def coverage_task_description + "Print RDoc coverage report" + end + private def rdoc_target @@ -315,6 +335,10 @@ class RDoc::Task < Rake::TaskLib end end + def coverage_task_name + "coverage" + end + end # :stopdoc: |