propshaft 0.6.1 → 0.6.3
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 -1
- data/lib/propshaft/compilers/css_asset_urls.rb +1 -1
- data/lib/propshaft/load_path.rb +9 -1
- data/lib/propshaft/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e186c6a8b298be03fa1f414751bf99e425614701c2283eafeafc49d14a10dd9
|
4
|
+
data.tar.gz: d447859d4a45ae4d7f62b54d71a9ce5c4d15d2151c98a3369cd33229587a1441
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 337241f55febf946b0b4e508012d3f8737882c8fc92665f84a6d407ec52a93acd9c11840f456897f8100294665ce4dac5ae6b70c79ca08b25479c6cf4689877e
|
7
|
+
data.tar.gz: e436e82a80404f84eb27e32e493d38bda181e80b08b8c0ca788a69354bd97eef51b2c73ddfff62ebeb6407ecf553b15a290bf5680d7e2fcd7150ede657675dcb
|
data/README.md
CHANGED
@@ -18,7 +18,7 @@ With Rails 7+, you can start a new application with propshaft using `rails new m
|
|
18
18
|
|
19
19
|
Propshaft makes all the assets from all the paths it's been configured with through `config.assets.paths` available for serving and will copy all of them into `public/assets` when precompiling. This is unlike Sprockets, which did not copy over assets that hadn't been explicitly included in one of the bundled assets.
|
20
20
|
|
21
|
-
You can however exempt directories that have been added through the `config.assets.excluded_paths`. This is useful if you're for example using `app/assets/stylesheets` exclusively as a set of inputs to a compiler like Dart Sass for Rails, and you don't want these input files to be part of the load path.
|
21
|
+
You can however exempt directories that have been added through the `config.assets.excluded_paths`. This is useful if you're for example using `app/assets/stylesheets` exclusively as a set of inputs to a compiler like Dart Sass for Rails, and you don't want these input files to be part of the load path. (Remember you need to add full paths, like `Rails.root.join("app/assets/stylesheets")`).
|
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
|
|
@@ -3,7 +3,7 @@
|
|
3
3
|
class Propshaft::Compilers::CssAssetUrls
|
4
4
|
attr_reader :assembly
|
5
5
|
|
6
|
-
ASSET_URL_PATTERN = /url\(\s*["']?(?!(?:\#|data|http))([^"'\s)]+)
|
6
|
+
ASSET_URL_PATTERN = /url\(\s*["']?(?!(?:\#|data|http))([^"'\s?#)]+)([#?][^"']+)?\s*["']?\)/
|
7
7
|
|
8
8
|
def initialize(assembly)
|
9
9
|
@assembly = assembly
|
data/lib/propshaft/load_path.rb
CHANGED
@@ -4,7 +4,7 @@ class Propshaft::LoadPath
|
|
4
4
|
attr_reader :paths, :version
|
5
5
|
|
6
6
|
def initialize(paths = [], version: nil)
|
7
|
-
@paths
|
7
|
+
@paths = dedup(paths)
|
8
8
|
@version = version
|
9
9
|
end
|
10
10
|
|
@@ -65,4 +65,12 @@ class Propshaft::LoadPath
|
|
65
65
|
def clear_cache
|
66
66
|
@cached_assets_by_path = nil
|
67
67
|
end
|
68
|
+
|
69
|
+
def dedup(paths)
|
70
|
+
[].tap do |deduped|
|
71
|
+
Array(paths).map(&:to_s).sort.each do |path|
|
72
|
+
deduped << Pathname.new(path) if deduped.blank? || !path.start_with?(deduped.last.to_s)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
68
76
|
end
|
data/lib/propshaft/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: propshaft
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-02-
|
11
|
+
date: 2022-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|