-
Notifications
You must be signed in to change notification settings - Fork 53
/
yard.rake
33 lines (27 loc) · 1.12 KB
/
yard.rake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# @note All options not specific to any given rake task should go in the .yardopts file so they are available to both
# the below rake tasks and when invoking `yard` from the command line
if defined? YARD
namespace :yard do
YARD::Rake::YardocTask.new(:doc) do |t|
# --no-stats here as 'stats' task called after will print fuller stats
t.options = ['--no-stats']
t.after = Proc.new {
Rake::Task['yard:stats'].execute
}
end
# need environment so that yard templates can load ActiveRecord::Base subclasses for Entity-Relationship Diagrams
task :doc => :eager_load
desc "Shows stats for YARD Documentation including listing undocumented modules, classes, constants, and methods"
task :stats => :environment do
stats = YARD::CLI::Stats.new
stats.run('--compact', '--list-undoc')
end
end
# @todo Figure out how to just clone description from yard:doc
desc "Generate YARD documentation"
# allow calling namespace to as a task that goes to default task for namespace
task :yard => ['yard:doc']
end
task eager_load: :environment do
Rails.application.eager_load!
end