On Jan 15, 2011, at 04:07 , Joseph Lenton wrote:

>> The solution is to use a real ruby editor (emacs, vim, textmate, I'm
>> sure many others) that supports proper indentation. The problem pops =
out
>> visually and is easily solved before it is even a problem.
>>=20
>=20
> I already do use a proper editor and indent my code correctly, but =
there=20
> are times when they can still slip through.

I almost never have this happen in emacs (past a couple lines of =
coding). It is pretty much automatically pointed out as soon as I hit =
return and then later hit tab to indent. (I used to bind return to =
newline-and-indent, but that gets really slow with larger files--esp w/ =
ruby).

Either you wind up with code like:

> def x
>   if x then
>     blah
>=20
>     rest_of_method
>=20
>   end

or you wind up with:

> def x
>   if x then
>     blah
>   end
>=20
>   rest_of_method
> end
> end

Hanging end or repeated end is a clear indicator that you slipped up and =
either missed an end or added one too many.=