Class | Jammit::Packager |
In: |
lib/jammit/packager.rb
|
Parent: | Object |
The Jammit::Packager resolves the configuration file into lists of real assets that get merged into individual asset packages. Given the compiled contents of an asset package, the Packager knows how to cache that package with the correct timestamps.
force | [RW] | Set force to false to allow packages to only be rebuilt when their source files have changed since the last time their package was built. |
package_names | [RW] | Set force to false to allow packages to only be rebuilt when their source files have changed since the last time their package was built. |
Caches a single prebuilt asset package and gzips it at the highest compression level. Ensures that the modification time of both both variants is identical, for web server caching modules, as well as MHTML.
Ask the packager to precache all defined assets, along with their gzip‘d versions. In order to prebuild the MHTML stylesheets, we need to know the base_url, because IE only supports MHTML with absolute references. Unless forced, will only rebuild assets whose source files have been changed since their last package build.
Return a list of all of the packages that should be cached. If "force" is true, this is all of them — otherwise only the packages that are missing or whose source files have changed since the last package build.
Compiles the list of assets that goes into each package. Runs an ordered list of Dir.globs, taking the merged unique result. If there are JST files in this package we need to add an extra path for when package_assets is off (e.g. in a dev environment). This package (e.g. /assets/package-name.jst) will never exist as an actual file but will be dynamically generated by Jammit on every request.
Absolute globs are absolute — relative globs are relative to ASSET_ROOT. Print a warning if no files were found that match the glob.