Class: AssetMapper::Configuration

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Dry::Configurable
Defined in:
lib/asset_mapper/configuration.rb

Overview

Configuration object for asset mapper. This is the top level API.

Instance Method Summary collapse

Instance Method Details

#asset_filesArray<String>

Files for AssetMapper to watch for changes and generate hashes for. Accepts glob patterns like Dir.

Returns:

  • (Array<String>)


33
# File 'lib/asset_mapper/configuration.rb', line 33

setting :asset_files, default: []

#cache_manifestBoolean

Whether or not to cache the manifest.

Returns:

  • (Boolean)


20
# File 'lib/asset_mapper/configuration.rb', line 20

setting :cache_manifest, constructor: lambda { |value| !!value }

#manifestAssetMapper::Manifest

Returns an instance of the manifest.



57
58
59
# File 'lib/asset_mapper/configuration.rb', line 57

def manifest
  @manifest ||= Manifest.new(config)
end

#manifest_filesString[]

Where to find the json mapping of your asset files.

Returns:

  • (String[])


13
# File 'lib/asset_mapper/configuration.rb', line 13

setting :manifest_files, default: []

#manifest_generatorAssetMapper::ManifestGenerator

Returns an instance of a manifest generator. This is for files that are watched by asset_mapper.



63
64
65
# File 'lib/asset_mapper/configuration.rb', line 63

def manifest_generator
  @manifest_generator ||= ManifestGenerator.new(config)
end

#raise_on_duplicate_keyBoolean

Raise an error if the same key is found twice across the same or multiple manifests.

Returns:

  • (Boolean)


28
# File 'lib/asset_mapper/configuration.rb', line 28

setting :raise_on_duplicate_key, default: false

#raise_on_missing_fileBoolean

Raise an error if the file can’t be found. Useful in development.

Returns:

  • (Boolean)


24
# File 'lib/asset_mapper/configuration.rb', line 24

setting :raise_on_missing_file, default: false