My new Rails setup
I recently spent about 10 hours over the week completely going over each of my 'starter gems' for every project, looking to improve upon my setup.
Not going to lie.. it was agonizing and it was sparked off by a problem that took me forever of digging and rooting around to solve it. In the end it was Spork. Eventually I explored so much, and talked to so many people about the problem that I found a lot of much nicer tools in the process.
These are all subjective obviously, but below is my new setup which I think is infinitely better than what I was using before.
- zeus - I'd consider this the absolute best improvement. It's like booting up a space shuttle the first time you gaze upon its beauty. It's meant to replace Spork, which now feels very 2010. Best of all, it works for migrate, rake, generate, server, console, and all the common rails tasks you run. It is much more intelligent than spork, and much, MUCH faster. Gone are the days of continually restarting spork. It also doesn't pollute your spec_helper.rb. note:, for ultimate development performance you need to use a patched version of ruby. All the versions are linked from the zeus github page.
- guard - I used this instead of watcher or autoload. It comes with a ton of great settings, and also feels a lot more intelligent. I found watchr to bug out sometimes after having created new files I would need to restart it.
- guard-rspec - This is for RSpec with Guard (right above). The nice thing about this is it comes with a setting to very easily integrate with zeus, by setting
:zeus => true.
- rspec-rails - This one's obvious, but I'm including it for completeness.
- capybara - This one everyone should know, but this leads me to the next one...
- poltergeist - This is so you can do your integration tests with phantomjs instead of selenium. There's a very great tip here that allows you to leave the setting for transactions set to true (normally it must be false so that the testing browser would have access to the db). This allows for a good performance boost. See #3 on that link.
- show-me-the-cookies - A great gem for managing cookies and sessions while testing. You can expire the session to test things like "remember me" features and so on.
- factory-girl-rails - I'm sure everyone knows this one. Not 100% sold on this but we shall see. I like thoughtbot a lot, and the work they put out.
- faker - for creating random test data. I didn't look for too many other solutions for this one so there could be something out there that's better.