propshaft 0.6.1 → 0.6.2
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: '093a9091a76c74f7885e10c18b605647bdf42ff97c0f670adc7ff35aa524b659'
|
4
|
+
data.tar.gz: f82c8fc8f47d681bd32e3924a8e2bab63c9755bd1581c3179b48d2091de617eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97ae388c2636971782fba9b6cbb83146e6117e5da8df0139d1abdc99c2da32a614117b30b9aeddc0e8ab9ab79fbb8b3497d51177b34a7af57b37dec3a1ce0fbd
|
7
|
+
data.tar.gz: 4977d80862d034f79345a163afa2faeb900b703ec2b6558aab35d7f9baa5d2a1d09e3ca38fe51d7439cb4c31b38cb1ae314131bf353b61789ae3e6d7db2fc9af
|
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).sort.each do |path|
|
72
|
+
deduped << Pathname.new(path) if deduped.blank? || !path.to_s.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.2
|
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
|