Tbpgr Blog

Employee Experience Engineer tbpgr(てぃーびー) のブログ

YARD | YARDをRakeから呼び出す

概要

YARDをRakeから呼び出す

内容

YARDをRakeから呼び出します。

rakeタスクの作成

lib/tasksにyard.rakeを作成

require 'yard'
require 'yard/rake/yardoc_task'
FILES = ['app/controllers/**/*.rb',
              'app/helpers/**/*.rb', 
              'app/mailers/**/*.rb', 
              'app/models/**/*.rb']
OPTIONS = ['--debug', '--verbose']

YARD::Rake::YardocTask.new do |t|
  t.files   = FILES
  t.options = []
  t.options << OPTIONS if $trace
end

実行

bundle exec spring rake yardoc