Verbose Logging

software development with some really amazing hair

T + G I F R

rc Files and You: Automating Your Project

· · Posted in Programming
Tagged with

I gave a lightning talk at RubyConf 2012 in Denver.

Man was I nervous.

Apparently I did an okay job though, and I'd like to thank all the people who were and took time out of their day to listen to me. Thanks! If you want to view the original talk, the video is here. Scroll to 10:15 to find me, but I recommend watching them all.

A few people had more questions (I talked really fast since it was a lightning talk after all) and this was originally going to be a blog post in the first place, so here it is, in blog form.

Your app is not one language.

It's not just ruby/python/java/go/pascal/ada/whatever. It really isn't.

You at least have bash, or whatever shell you use, and it gives you a bunch of tools.

Bash for example has functions, loops and conditionals, so you're well on your way to programming yourself out of a paper bag.

Another trick with bash (and most other shells) is that you can source files to load things into the current process. You do this everytime you start a shell actually. A .profile or .bashrc probably loads up a bunch of stuff. I have a whole mess of stuff in my dotfiles.

What I like to do is dump a bunch of project specific things into a file in the root project directory named rc. This way, I can cd into the directory and then type . rc and bash will load up all that stuff, kind of setting me up to work on the project.

My rc File For ForrestFire (source for Tinderizer.com)

I built Tinderizer.com and the source repo is called ForrestFire. I have this little blob in its rc file. I set a GOPATH variable, grab some configuration values from Heroku where the site is hosted, and have a function to tell the server to reload the bookmarklet when I change it.