Introducing rake-rails

JRubyConf 2012 was a blast. Thanks Nick and all the others who made it happen.

I enjoyed many of the talks, including Adventures on the Golden Path by Jeff Casimir.

Admittedly, I do not agree with all of his ideas or his implementations, but one that struck me as a good idea and low hanging fruit was the confusion among the rails and rake commands:

Beginners and advanced users get tripped up by this one all the time.

So, I tried whipping up a gem that delegates rake generate, rake console, etc.. to their respective rails command.

It's called rake-rails:

# Gemfile
gem 'rake-rails'

Profit! You can now run ALL the things with rake.

$ rake generate migration add_name_to_users name:string
$ rake console staging
# ...

For efficiency freaks: it's still pretty fast and does not involve loading the Rails environment multiple times; it simply delegates to rails/cli as quickly as possible, just like the rails command does.

Try it out and let me know what you think! Everything is up on GitHub.

— May 23, 2012
blog comments powered by Disqus