Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Auto-populate socket value in rails database.yml using TextMate snippet (See related posts)


When using mysql for rails apps, you may need a
socket:
value. I can never remember mine. So I added a TextMate snippet to find it. (read below for non-TextMate)

Snippet text:

socket: `mysql_config --socket`


Activation:
socket:


Scope selector:
source.yaml - string


<h3>Usage:</h2>

In your database.yml, go to the line
socket: 
, delete any blank spaces til the cursor is at the colon, then press TAB and wait. The line will be updated with the socket location.


<h3>Non-TextMate</h3>

If you don't have textmate, you can get your socket location using:

mysql_config --socket


And paste the result into your database.yml

You need to create an account or log in to post comments to this site.


Click here to browse all 5201 code snippets

Related Posts