From: Harry Truax Date: 2011-07-28T01:40:00+09:00 Subject: Re: Counting lines of code in a ruby code file ignoring method code lines in the process --000e0cd22f30e7458604a90fb224 Content-Type: text/plain; charset=ISO-8859-1 Thanks for the reply Peter. Yeah, I thought about something like that, but there could be a method where the end is on the same line as the corresponding statement, like def do_this (y) x = y + 10 end or inside the method like if (x < y) x = y end I also thought about looking for a code line that started with 'end' and using that to conclude that the method was finished, but someone could have mistakenly typed a space char in fron t of it when writing it. Appreciate your help! Harry On Wed, Jul 27, 2011 at 11:04 AM, Peter Hickman < peterhickman386@googlemail.com> wrote: > Well this could be a bit of a cheat but you could put the code through > a formatter which will indent the code to the same level and then when > you encounter a 'def' with x leading spaces you know that the paired > 'end' should also have x leading spaces (and be on a line by itself). > > Seems to be cheating but would probably work. > > -- Harry Truax Phone: 315.463.8506 Email: htruax@stf.com 26 Corporate Circle East Syracuse, NY 13057 --000e0cd22f30e7458604a90fb224--