rails/rails — pull request #7927 by josh (2012-10-12 22:20:15+00:00)
Title: Refactor AssetUrlHelper

Follow up #7923. Theres a couple things happening here.

**asset_path, asset_url**

Originally inspired the [current sprockets rails plugin](https://github.com/rails/sprockets-rails/blob/master/lib/sprockets/rails/helpers/rails_helper.rb#L55-60), bd38d9f2118b1005718f8db4292b21a73879409e adds general purpose `asset_path` and `asset_url` helpers. All the other helpers simply funnel through this main point. Makes it possible for extensions to change the behavior of all the helpers w/o redefining each.

**Remove AssetPaths**

There doesn't not a whole lot of documentation indicating that this class was ever okay to use publicly. And theres no tests asserting it either. Just :fire:ing it.

The core of it is replaced by inline helper methods, `compute_asset_path` and `compute_asset_host`. Both these methods should now be considered public. Apps or plugins can call them directly or override them to change there behavior.

**Isolate old asset id code**

I've move all the old asset id mtime query stuff into a separate module, `AssetIdHelper`. It uses the now `compute_asset_path` to set itself up.

Since this is now modular, it wouldn't be a bad time to kill it or move it out into an optional plugin. I'd like to get @dhh's take on this.

* :fire: it
* extract it into a plugin
* or just leave it as is

**Bonus**

You should be able to include `ActionView::Helpers::AssetUrlHelper` into `AC::Base` just fine now.

/cc @dhh @steveklabnik @guilleiguaran @rafaelfranca