如何在 rdoc 中显示常量值?

How to show constant value in rdoc?

是否可以让 rdoc 也显示常量的值,而不仅仅是它的注释?目前正在生成

Constants

DEFAULT_CONFIG_FILE

    Default configuration file location

我想得到的是

Constants

DEFAULT_CONFIG_FILE = '~/config.yaml'

    Default configuration file location

给出源代码

DEFAULT_CONFIG_FILE = '~/config.yaml'

我怎样才能做到这一点?

你必须create a custom template

Here is the offending line in the template that only shows the name. You'll have to add a reference to const.value.

也许像这样简单:

<dt id="<%= const.name %>"><%= const.name %> = <%= const.value %>