DRY database.yml, old saw

See this Pastie, which makes use of File.socket?, Enumerable‘s amazing detect and an ERb variable.

On the #rubyonrails.se IRC channel, simmel made the recipe better by adding the check for File.socket?, instead of File.exists?. (File.socket? will follow symbolic links, as you can see in the pasted code.)

A recipe variation, you might call it.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>