3
好吧,我有任务在那里我必须提取ruby文件的方法和意见,这一点,我管理着这片分拆之前在DB将它们存储为参考获得从红宝石文件+ YARD
方法和意见代码来达到同样的
module Describe
def describe(method_name,description)
@@method_descriptions ||= []
@@method_descriptions << [method_name,description]
end
def method_descriptions
Hash[@@method_descriptions]
end
end
,然后用像这样一类
class A
extend Describe
def call_me
end
describe :call_me,"This method is you to invoke"
end
但事实证明,我必须写一些代码来这也是他们不是ACTUA内升评论
我可以实现与YARD同样的事情
我知道YARD提取注释也不需要添加文档使用YARD文件我所需要的是读取文件中的评论提及并将它们存储在数据库中 – Ratatouille