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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f7f4103bd65db2fdda3e1e8817f9d14951c48c2e823794c6167b90363931f48d
4
- data.tar.gz: dd2503eb87c35fbf647618c2d840f05705583dfabcaac41ae68624923d92736f
3
+ metadata.gz: 4fb19ffec4a1b49b3b461cb49ef3f726923bbb3b3a0c4b86e26eaed855208572
4
+ data.tar.gz: 9412606330821085f921519f5a09e96080f49be193a2a675be063dabe8fc1dcd
5
5
  SHA512:
6
- metadata.gz: 5d0a9695812b4fa23ada2001d8f6f8adcc6d4cd8d724fe433fc08aeef48262e3b24e9de5a48ebde7b1d2aafee0ee5d58216ed9b252bdd7ba9fc10b0e87334250
7
- data.tar.gz: 905a4681b68df4fa2020fc7a17e7b3fb50e6b67b9b332a903cbf2752aca3c6d83e03c5d198fa680e06299d1743a1ec0787e88f4f43ca2498dd94e46e73d09b63
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-path` function calls in CSS to `url(digested-asset)` instead.
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
 
@@ -11,5 +11,11 @@ module Propshaft::Resolver
11
11
  File.join prefix, asset.digested_path
12
12
  end
13
13
  end
14
+
15
+ def read(logical_path)
16
+ if asset = load_path.find(logical_path)
17
+ asset.content
18
+ end
19
+ end
14
20
  end
15
21
  end
@@ -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)
@@ -1,3 +1,3 @@
1
1
  module Propshaft
2
- VERSION = "0.6.0"
2
+ VERSION = "0.6.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: propshaft
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson