I often write things like this:

class ...
  def ...
    raise "Directory #{dir} already exists." if FileTest.directory?(dir)  
  end
end

Then I see it is too long to catch in just one glimpse, and one has to
read further to find the condition that actually triggers the
raising.  So I rewrite it:

    if FileTest.directory?(dir) then raise "Directory #{dir} already exists." end

The condition stands, but the line is even longer.  So...

    if FileTest.directory?(dir)
      raise "Directory #{dir} already exists."
    end

And I've taken three lines in a method.

It happens sometimes that I have the three styles play ping-pong among
each other, and I change from one to another over various sessions
depending on what I had for lunch and other very scientific
considerations.

I was wondering if a *little* syntactic sugar would help, something
that is readable, makes the condition stand, can be read in one
glimpse, and lies on a single line.

What do you think of something like this?

    FileTest.directory?(dir) -> raise "Directory #{dir} already exists."    



Massimiliano