Okay, so it turned out that reading the rake documentation was helpful as heckfire.
- Rails generates a rakefile by default. It contains:
- File.expand_path retrieves an absolute path. The second argument __FILE__ is the place for expand_path to start searching. This expands to /path/to/rails/app/Rakefile
- The first argument to expand_path is ‘../config/application’. The .. means “/path/to/rails/app/Rakefile” becomes “/path/to/rails/app”. Then “/config/application” is appended.
- Once the application config is retrieved, then the task YourAppNameSpace::Application.load_tasks is performed. This loads the rake tasks so that rake -vT can see ’em.
require File.expand_path('../config/application', __FILE__)