cat_herder
Minimal Rails asset pipeline experiment:
- 
Assets are fingerprinted and copied to public/assetsin development, just likerails assets:precompile. Thus they are served directly, without any special routes or middleware.
- 
ERB assets are evaluated; all other assets are copied verbatim. 
- 
ERB assets can call asset_pathand all otherAssetUrlHelperhelpers.- Currently, *_urlhelpers always return a path instead of a full URL (the same as*_pathhelpers). Assuming these helpers are primarily used for import statements (e.g.@import url(...)), this shouldn't pose a problem, because the browser resolves such partial URLs to the asset host rather than the page host. The benefit of the current implementation is that it sidesteps the issue of cache invalidation whenconfig.asset_hostchanges.
 
- Currently, 
- 
ERB assets can call renderto render the content of another asset inline.
- 
ERB assets can call globto iterate over other assets. Using a given pattern,globwill search all load paths. With a combination ofglobandrender, assets can perform their own bundling.
- 
ERB assets can call resolveto get an absolute path to an asset file. This can be used to pass the asset to an external command, e.g.:<%# styles.css.erb %> <%= `sass #{resolve "styles.sass"}` %> 
- 
All calls to asset_path/compute_asset_path,render, andresolvewill add the resulting asset to the current asset's dependencies, so that the current asset will be recompiled when any of its dependencies are.
- 
Partial assets are prefixed with an underscore (like view partials), and are not copied to public/assetsbyrails assets:precompile. They can be referenced using their logical path without the underscore (like view partials). This allows "private" files, such as raw input files or config files, to be placed in any of the asset load paths and be evaluated like other assets. (Calls tocompute_asset_paththat resolve to a partial asset will raise an error to prevent broken URLs.)
Installation
Add this line to your application's Gemfile:
gem "cat_herder"And run:
$ bundle installThen disable Sprockets, and require cat_herder in your config/application.rb
file:
require "cat_herder/railtie"Contributing
Run bin/test to run the tests.