On a recent project we ran into a situation where we needed a more advanced way of parallelizing Capistrano tasks than just using the parallel method it already sports. To jog your memory, parallel can run arbitrary shell commands in parallel on different servers. So if you wanted your webserver to already restart the processes while you restart your background processes, you can do it like this:
Pat Maddox recently published a blog post on mocking called “You Probably Don’t Get Mocks.” I wanted to write something on my experiences with mocks for a while now, so here’s good reason to finally do so. I’m a recovering mock addict, if you will, so this is my retribution of things I learned over the last 18 months, and how my testing workflow changed with them.
It seems to be common sense these days to throw a search engine, a database slave or an external cache at your application in even the earliest stages of a project. Let me just give you my two cents on the issue, and why I think that’s a bad idea.
There’s something I see in lots of projects is an overuse of
self. Sure, it looks a lot nicer than
this, but its overuse can clutter code quite easily. Here’s a rather simple example.