This patch refactors the Sprockets asset path helpers to make it easier to integrate alternate asset environments and prefixes. In my specific case, this makes integrating themes using the asset pipeline a whole lot easier.
The main change is to source the asset environment and prefix from helper-level methods (asset_environment and asset_prefix), rather than hard-coded within the AssetPaths class.
Refactor sprockets asset paths to allow for alternate asset environments
Could you please add a test case with the kind of customization you have in mind, otherwise someone can change it again in the future and nothing in the test suite will point it as a regression. Docs are also important so other people can customize it as well. Finally, shouldn't those changes be done in the ActionView::AssetPaths so the whole AssetPaths chain is more flexible?
Add tests for alternate asset prefix/environment
I've added some tests and will work on some documentation.
These changes are specific to Sprockets and the asset pipeline so I think they fit best within Sprockets::Helpers::RailsHelper.
It looks good with tests now! Please ping me after you add some docs to the two methods you added and I will merge it.
Add documentation for asset_prefix and asset_environment
Hopefully ready to merge now.