module
Amber::Assets
Overview
Runtime access to the build-time static asset manifest.
Asset compilation belongs in the build or deploy step. Amber only reads the resulting manifest while serving requests, so production filesystems can be read-only and request latency never includes asset generation.
Defined in:
amber/assets.crConstant Summary
-
DEFAULT_MANIFEST_PATH =
"public/assets/manifest.json"
Class Method Summary
-
.configure(*, manifest_path : String = DEFAULT_MANIFEST_PATH) : Nil
Configures the persisted manifest Amber reads.
- .entry(logical_path : String) : Entry
- .expected_public_path(logical_path : String, digest : String, public_path : String) : String
- .integrity(logical_path : String) : String
- .manifest : Manifest
- .manifest_path : String
- .normalize_logical_path(path : String) : String
- .normalize_public_path(path : String) : String
- .path(logical_path : String) : String
- .public_reference?(path : String) : Bool
-
.reload! : Manifest
Clears the cached manifest.
-
.resolve(path : String) : String
Absolute, protocol, fragment, and data URLs are already public references and remain unchanged.
-
.sha256_hex_digest?(digest : String) : Bool
Returns
truewhen digest is 64 lowercase hex digits, a SHA-256 digest as the manifest writes it. -
.sha256_integrity?(integrity : String) : Bool
Returns
truewhen integrity is a Subresource Integrity value for one SHA-256 digest:sha256-, 43 base64 characters, then=.
Class Method Detail
Configures the persisted manifest Amber reads. Relative paths are resolved by the application process, normally from the project root.
Clears the cached manifest. This is useful after an in-process development build and in tests; production applications normally never need it.
Absolute, protocol, fragment, and data URLs are already public references and remain unchanged. Other values are strict logical manifest keys.
Returns true when digest is 64 lowercase hex digits, a SHA-256
digest as the manifest writes it.
Returns true when integrity is a Subresource Integrity value for one
SHA-256 digest: sha256-, 43 base64 characters, then =.