propshaft 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -3
- data/lib/propshaft/resolver/dynamic.rb +6 -0
- data/lib/propshaft/resolver/static.rb +6 -0
- data/lib/propshaft/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4fb19ffec4a1b49b3b461cb49ef3f726923bbb3b3a0c4b86e26eaed855208572
|
4
|
+
data.tar.gz: 9412606330821085f921519f5a09e96080f49be193a2a675be063dabe8fc1dcd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6fa6e1ab77e53f99a3270567dfda307e798af395e87ff4ecebc47ddadf33839be364d23f24168d7c9050d8844ae9d2ebd119b9bd5bf722ac61c1a98fc7a82312
|
7
|
+
data.tar.gz: 4cdb5cc250bef4cfb43cf4d58cbecaa0fe001ac3f3fae51906733ff64b53f06388899f1c26f0aa5e06b4f98b000e294ccb2688e93c15bd4c546500b40c085f19
|
data/README.md
CHANGED
@@ -7,7 +7,7 @@ So that's what Propshaft doesn't do. Here's what it does provide:
|
|
7
7
|
1. **Configurable load path**: You can register directories from multiple places in your app and gems, and reference assets from all of these paths as though they were one.
|
8
8
|
1. **Digest stamping**: All assets in the load path will be copied (or compiled) in a precompilation step for production that also stamps all of them with a digest hash, so you can use long-expiry cache headers for better performance. The digested assets can be referred to through their logical path because the processing leaves a manifest file that provides a way to translate.
|
9
9
|
1. **Development server**: There's no need to precompile the assets in development. You can refer to them via the same asset_path helpers and they'll be served by a development server.
|
10
|
-
1. **Basic compilers**: Propshaft was explicitly not designed to provide full transpiler capabilities. You can get that better elsewhere. But it does offer a simple input->output compiler setup that by default is used to translate `asset
|
10
|
+
1. **Basic compilers**: Propshaft was explicitly not designed to provide full transpiler capabilities. You can get that better elsewhere. But it does offer a simple input->output compiler setup that by default is used to translate `url(asset)` function calls in CSS to `url(digested-asset)` instead and source mapping comments likewise.
|
11
11
|
|
12
12
|
|
13
13
|
## Installation
|
@@ -22,8 +22,6 @@ You can however exempt directories that have been added through the `config.asse
|
|
22
22
|
|
23
23
|
These assets can be referenced through their logical path using the normal helpers like `asset_path`, `image_tag`, `javascript_include_tag`, and all the other asset helper tags. These logical references are automatically converted into digest-aware paths in production when `assets:precompile` has been run (through a JSON mapping file found in `public/assets/.manifest.json`).
|
24
24
|
|
25
|
-
Additionally, Propshaft ships with a CSS function called `asset-path("image.svg")` that'll be compiled into `url("/assets/image-f2e1ec14d6856e1958083094170ca6119c529a73.svg")` when doing `assets:precompile`. This function is applied to all `.css` files.
|
26
|
-
|
27
25
|
|
28
26
|
## Bypassing the digest step
|
29
27
|
|
@@ -12,6 +12,12 @@ module Propshaft::Resolver
|
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
|
+
def read(logical_path)
|
16
|
+
if asset_path = parsed_manifest[logical_path]
|
17
|
+
manifest_path.dirname.join(asset_path).read
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
15
21
|
private
|
16
22
|
def parsed_manifest
|
17
23
|
@parsed_manifest ||= JSON.parse(manifest_path.read)
|
data/lib/propshaft/version.rb
CHANGED