문제

I have a series of Ruby methods andI would like to dump their return values out to a formatted report. However, I'd also like to annotate these results (i.e. with descriptions of what the value is), and I was wondering if I could use the existing comments on each method to do this annotating?

So I guess what I want to do is output the rdoc as normal but for each method actually run the method with an argument. The argument is the same for every single method, which simplifies it.

도움이 되었습니까?

해결책

with 1.9 there is a Method#source_location that might be helpful for you (ripper might help,too). Also note: http://github.com/rdp/arguments might be helpful

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top