Class: Merb::Assets::AbstractAssetBundler

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

An abstract class for bundling text assets into single files.

### Methods

add_callback asset_type bundle! bundle_files cache_bundle cached_bundle? callbacks new purge_bundle

### Included Modules

Merb::Assets::AssetHelpers

### External Aliases

add_callback | -> | after_bundling

### Public Class methods

add_callback(&block)

#### Parameters

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

#### Examples

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

asset_type()

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

cache_bundle(name)

Mark a bundle as cached.

#### Parameters

name<~to_s>: | Name of the bundle

cached_bundle?(name)

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.

callbacks()

Retrieve existing callbacks.

#### Returns

Array[Proc]: | An array of existing callbacks.

new(name, *files)

#### 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_bundle(name)

Purge a bundle from the cache.

#### Parameters

name<~to_s>: | Name of the bundle

### Public Instance methods

bundle!()

Creates the new bundled file, executing all the callbacks.

#### Returns

Symbol: | Name of the bundle.

### Protected Instance methods

bundle_files(filename, *files)

Bundle all the files into one.

#### Parameters

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

[Validate]