If you have rake tasks that don't rely on rails, it's really annoying that rails has to load before the tasks runs.
Instead this rakefile only loads rails if a rake task which depends on :environment
is called.
One caveat is that rake -T won't list rails/gem tasks, hence the added warning. To show all tasks use rake -T LOAD_RAILS=1
With thanks to @xshay http://rhnh.net/2010/09/07/speeding-up-rails-rake
Any thoughts?
The latest revision monkey patches rake, so that we load rails if we can't find a task, seems a cleaner way of doing it, and avoids rake failing if you call a task that actually exists but is internal to rails/a gem.