Class Merb::Assets::AbstractAssetBundler
In: lib/merb-assets/assets.rb
Parent: Object

An abstract class for bundling text assets into single files.

Methods

Included Modules

Merb::Assets::AssetHelpers

External Aliases

add_callback -> after_bundling

Public Class methods

Parameters

&block:A block to add as a post-bundle callback.

Examples

  add_callback { |filename| `yuicompressor #{filename}` }

The type of asset for which the bundler is responsible. Override this method in your bundler code.

Raises

NotImplementedError:This method is implemented by the bundler.

Returns

Symbol:The type of the asset

Mark a bundle as cached.

Parameters

name<~to_s>:Name of the bundle

Test if a bundle has been cached.

Parameters

name<~to_s>:Name of the bundle

Returns

Boolean:Whether the bundle has been cached or not.

Retrieve existing callbacks.

Returns

Array[Proc]:An array of existing callbacks.

Parameters

name<~to_s>:Name of the bundle. If name is true, it will be converted to :all.
*files<String>:Names of the files to bundle.

Purge a bundle from the cache.

Parameters

name<~to_s>:Name of the bundle

Public Instance methods

Creates the new bundled file, executing all the callbacks.

Returns

Symbol:Name of the bundle.

Protected Instance methods

Bundle all the files into one.

Parameters

filename<String>:Name of the bundle file.
*files<String>:Filenames to be bundled.

[Validate]