From: Rob Biedenharn Date: 2008-02-19T00:14:04+09:00 Subject: Re: Proper way to RDoc markup? not quite Well, if you take a look at vendor/rails/railties/lib/code_statistics.rb while line = f.gets stats["lines"] += 1 stats["classes"] += 1 if line =~ /class [A-Z]/ stats["methods"] += 1 if line =~ /def [a-z]/ stats["codelines"] += 1 unless line =~ /^\s*$/ || line =~ /^ \s*#/ end You'll see that both forms will be counted as 3 LOC since the blank and comment-only lines are not counted as 'codelines'. -Rob Rob Biedenharn http://agileconsultingllc.com Rob@AgileConsultingLLC.com On Feb 15, 2008, at 11:17 PM, Jeremy McAnally wrote: > I'd rather have really readable code and good generated documentation > than 5 LOC. > > Of course, doing this often would throw off your app LOC to testing > LOC, now wouldn't it? ;) > > --Jeremy > > On Feb 15, 2008 5:42 PM, Gary Wright wrote: >> >> On Feb 15, 2008, at 5:28 PM, Jeremy McAnally wrote: >> >>> I guess...? You just need to pay attention to what you're doing. :P >>> I personally think this is more readable than inlining: >>> >>> # This does something fun >>> attr_reader :fun >>> >>> # This does something writable >>> attr_accessor :read_write >>> >>> # This does something AWESOME >>> attr_accessor :forty_two >> >> Yuck, that is 8 lines vs. 3 (below). I always found it >> strange that RDOC didn't parse comments to the right >> of an accessor declaration yet that is exactly how >> attributes are documented in the HTML pages generated >> by RDOC. >> >> attr_reader :fun # This does something fun >> attr_accessor :read_write # This does something writable >> attr_accessor :forty_two # This does something AWESOME >> >> Gary Wright > > -- > http://jeremymcanally.com/ > http://entp.com > > Read my books: > Ruby in Practice (http://manning.com/mcanally/) > My free Ruby e-book (http://humblelittlerubybook.com/) > > Or, my blogs: > http://mrneighborly.com > http://rubyinpractice.com