2 years ago
Tuesday, November 27, 2007
Rails Rake Tasks Plugin
Just like everyone else who develops software, we found ourselves constantly typing the same commands over and over for a variety of little tasks while developing Rails apps. Over the course of a number of projects, we developed a collection of rake tasks to automate many of them.
I find some of the tasks really useful, so we created a plugin called the Sakuzaku Rails Rake Tasks Plugin to make them available to everyone.
Some of the tasks that are particular time-savers for me are:
db:remigrate, which drops your database and migrates it from scratch.db:migrate:all, which migrates both your development and test databases at once.db:migrations:test, which runs any uncommitted migrations backwards and forwards to test them.db:migrations:merge, which renames uncommitted migrations as necessary to make them follow any migrations committed while you’ve been working.- The testing convenience tasks, which drastically reduce the amount of typing necessary to run tests. For example, you can run all tests for the User model and User controller by doing
rake user(instead ofruby test/unit/user_test.rb ; ruby test/functional/user_controller_test.rb), or just thenametest on the User model withrake user:name(instead ofruby test/unit/user_test.rb -n test_name).
We’ve added this plugin to a little section of our site called the Sakuzaku Goodie Basket, which contains a growing collection of random, potentially useful, open-source stuff that we’ve developed. We’ll keep adding to the goodie basket as we have the time to pull out and write documentation for all the internal stuff we’ve developed that might be useful to other people. Watch for more additions soon.
Comments








In many applications (both Apple’s and those by third parties), the default menus are found in the 









