Class: Lotus::Assets::Config::DigestManifest Private

Inherits:
Object
  • Object
show all
Defined in:
lib/lotus/assets/config/manifest.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Digest manifest

Since:

  • 0.1.0

Instance Method Summary collapse

Constructor Details

#initialize(assets, manifest_path) ⇒ Lotus::Assets::Config::Manifest

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return a new instance

Parameters:

  • assets (Hash)

    the content of the digest manifest

  • manifest_path (Pathname)

    the path to the digest manifest

See Also:

Since:

  • 0.1.0



88
89
90
91
# File 'lib/lotus/assets/config/manifest.rb', line 88

def initialize(assets, manifest_path)
  @assets        = assets
  @manifest_path = manifest_path
end

Instance Method Details

#resolve(asset) ⇒ String

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Resolve the given asset into a digest path

For a given path /assets/application.js it will return /assets/application-28a6b886de2372ee3922fcaf3f78f2d8.js

Parameters:

  • asset (#to_s)

    the relateive asset path

Returns:

  • (String)

    the digest path

Raises:

Since:

  • 0.1.0



104
105
106
107
108
# File 'lib/lotus/assets/config/manifest.rb', line 104

def resolve(asset)
  @assets.fetch(asset.to_s) do
    raise Lotus::Assets::MissingDigestAssetError.new(asset, @manifest_path)
  end
end