-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathRakefile
More file actions
53 lines (41 loc) · 1.47 KB
/
Rakefile
File metadata and controls
53 lines (41 loc) · 1.47 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# frozen_string_literal: true
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require_relative 'config/application'
Rails.application.load_tasks
# YARD Documentation tasks
begin
require 'yard'
require 'yard/rake/yardoc_task'
namespace :doc do
desc "Generate YARD documentation"
YARD::Rake::YardocTask.new(:generate) do |t|
t.files = [ 'app/**/*.rb', 'lib/**/*.rb', '-', 'README.md' ]
t.options = [ '--output-dir', 'doc/yard', '--markup', 'markdown', '--title', 'Valera API Documentation' ]
end
desc "Regenerate documentation with cache reset"
task regenerate: [ 'doc:clean', 'doc:generate' ]
desc "Clean generated documentation"
task :clean do
rm_rf 'doc/yard'
rm_rf '.yardoc'
end
desc "Start YARD server for local documentation viewing"
task :serve do
sh "bundle exec yard server --reload --port 8808"
end
desc "Validate YARD documentation coverage"
task :coverage do
sh "bundle exec yard stats --list-undoc"
end
desc "Generate complete documentation with coverage report"
task complete: [ :generate, :coverage ]
end
# Add shorthand aliases
task yard: 'doc:generate'
task yard_server: 'doc:serve'
task yard_clean: 'doc:clean'
rescue LoadError
# YARD is only available in development/test environments
# Silence this warning in production where it's not needed
end