我在我的Rails應用程序中每個ruby文件的頂部都有神奇的評論# -*- encoding : utf-8 -*-。事情是,它出現在我的YARD文檔在每個類定義的概述部分: Overview
-*- encoding : utf-8 -*- The Book model contains a number of #etc
有沒有辦法我可以省略它?
如果我有一個文件如下: module Something
class Resource
# Defines a new property
# @param [String] name the property name
# @param [Class] type the property's type
# @macro [attach] prope
我正在尋找方法來迭代yardoc @macro的寄存器。我知道你能在一些使用它們就像如下: class Post
include DataMapper::Resource
# @macro dm.property
# @return [$2] the $1 $0 of the post
property :title, String
end
,你都能
當試圖生成使用Rails實現的服務YARD文件,我得到以下警告: $ yardoc
[warn]: in YARD::Handlers::Ruby::MixinHandler: Undocumentable mixin:
YARD::Parser::UndocumentableError for class MyClass
[warn]: in file 'app/models
我試圖用yard記錄一些Ruby代碼和即使我做什麼描述here或here # @param [Integer] the number of trials (>= 0)
# @param [Float] success probability in each trial
def initialize(n, p)
# initialize...
end
我仍然得到這個奇怪的錯誤,雖