Having a full-time Rails job can really spur you to find out more about what’s going on in Ruby and Rails. I’ve found that I’ve learned quite a bit about what’s going on in the last month and that I’m still learning at a breakneck pace, so here goes, in no particular order:
Piston
“Vendor branch management” gem that lets you store other projects (like Rails plugins) inside your own repository while retaining the ability to update them. This is particularly useful with Rails because you don’t really want to have outbound connections fetching your svn:externals every time you do a Capistrano deploy.
All my svn:externals have been Piston-ized.
EZ-Where
A Rails plugin that allows building the ActiveRecord find options hash based on Ruby code:
Article.findwhere(:all) { |article| article.publishedat < => (from..to) }
Great for complex queries. Using this plugin in WishRadar cut about 45 lines of code that generated SQL manually into about 12 of easy-to-read ruby.
Continuous Builder
An “Official” Rails plugin to make it easy to set up continuous integration testing with email and Campfire notification support. I’ve been using this for about two weeks and it’s pretty reliable, though setting it up with a Subversion post-commit and getting migrations to run is a little tricky. My hacked continuous_builder.rb’s make method:
def make
@output = cd #{@options[:application_root]} && #{@options[:bin_path]}rake db:migrate RAILS_ENV=test && #{@options[:bin_path]}rake db:migrate RAILS_ENV=development && #{@options[:bin_path]}rake #{@options[:task_name]} RAILS_ENV=test
make_successful?
end
To prevent Subversion from blocking when doing a commit, run scripts with STDERR redirected to STDOUT and put the process in the background:
/path/to/continuous-builder 2>&1 &
“My Rails Toolbox” Article
Wonderful list of stuff to use on a Rails site if you’re serious about going to production.
Caboo.se RDOC Documentation Project
They’ve started work on an app to make it easy to produce diffs for documentation purposes. Better Rails docs now!
FixtureScenarios
A large fixture set is very hard to manage, so a plugin to keep them in discrete ’scenarios’ making them independent and “preventing you from changing your assumptions in a dangerous way” is a great idea. Beware, though - it may not play nice with other fixture-related plugins. (in case you’re wondering, it’s better than FixtureSets)
memcached
A network-enabled memory store that basically acts like a giant hash. Good for sessions and whatever other data you need to cache in your app. See the article. Haven’t used it much but I’m looking forward to it (trying to avoid the premature optimization itch).
QueryTrace
A plugin to print a stack trace with each SQL query in your logs. This hasn’t proved invaluable yet, but I’m guessing that once we start optimizing our queries and caching, it’ll be a lifesaver.
hpricot
Fast - like C fast - forgiving HTML parsing. Yeah baby.
Rails 1.2
This will include ActiveResource, DHH’s latest code built to tackle one half of the REST web services problem, as well as some nifty enhancements to routes that will cover the other half.
RSpec
Unit testing done in a more DSLish way. Specify what should happen, and in what contexts, and you’re halfway done with your tests. Really more of a psychological helper than anything else, but that’s what good DSLs are for, right? Check it out at rubyforge. I haven’t tried this yet, but it’s on my list.