rake yard VS yardoc

128 Views Asked by At

I'm getting different results when I run yardoc vs when I run rake yard

$ yardoc
Files:         123
Modules:         4 (    0 undocumented)
Classes:       120 (    0 undocumented)
Constants:      11 (    0 undocumented)
Attributes:     16 (    0 undocumented)
Methods:       440 (    0 undocumented)
 100.00% documented

$ rake yard
Files:         123
Modules:         4 (    0 undocumented)
Classes:       120 (    0 undocumented)
Constants:      11 (    0 undocumented)
Attributes:     16 (    0 undocumented)
Methods:       544 (    2 undocumented)
 99.71% documented

I'm not sure where the extra 104 methods are coming from, or which 2 of them aren't documented yet. Is it coming from my gems?

I've tried looking for an answer but haven't found anything. Can somebody point me in the right direction to explain this discrepancy, or whether it really matters?

I've also tried running $ yard --list-nodoc but it gives me similar results to $ yardoc; which is why I'm asking.

1

There are 1 best solutions below

0
On

The YARD README should have the info you need. In particular, the yarddoc command "will assume your files are located in the lib/ directory", but this behavior can be customized in a .yardopts file.

Similarly, rake yard by default looks for files matching lib/**/*.rb, but this can be customized in the Rakefile, e.g.:

require 'yard'

YARD::Rake::YardocTask.new do |t|
  t.files   = ['lib/**/*.rb', OTHER_PATHS]
end

TL;DR: check the project's .yardopts and Rakefile files.