rails/rails — Issue #4393: assets:precompile task is unusable outside of rake
Author: joshuaclayton
Created: 2012-01-09 18:59:14+00:00
State: open

If I run `Rake::Task["assets:precompile"].invoke` via any program other than rake, the command fails as the `ruby_rake_task` method (within action_pack/lib/sprockets/assets.rake) uses `$0` to determine the binary. This means that if I were to have an external gem (https://github.com/thoughtbot/kumade, for example) invoke this rake task, the binary is `kumade` instead of `rake`. This is obviously incorrect behavior.

I'm not exactly sure what the history is behind using `$0` here (or why this is done in a separate process to begin with) so any insight would be appreciated. Thanks!