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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4fb19ffec4a1b49b3b461cb49ef3f726923bbb3b3a0c4b86e26eaed855208572
4
- data.tar.gz: 9412606330821085f921519f5a09e96080f49be193a2a675be063dabe8fc1dcd
3
+ metadata.gz: 2e186c6a8b298be03fa1f414751bf99e425614701c2283eafeafc49d14a10dd9
4
+ data.tar.gz: d447859d4a45ae4d7f62b54d71a9ce5c4d15d2151c98a3369cd33229587a1441
5
5
  SHA512:
6
- metadata.gz: 6fa6e1ab77e53f99a3270567dfda307e798af395e87ff4ecebc47ddadf33839be364d23f24168d7c9050d8844ae9d2ebd119b9bd5bf722ac61c1a98fc7a82312
7
- data.tar.gz: 4cdb5cc250bef4cfb43cf4d58cbecaa0fe001ac3f3fae51906733ff64b53f06388899f1c26f0aa5e06b4f98b000e294ccb2688e93c15bd4c546500b40c085f19
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)]+)\s*["']?\)/
6
+ ASSET_URL_PATTERN = /url\(\s*["']?(?!(?:\#|data|http))([^"'\s?#)]+)([#?][^"']+)?\s*["']?\)/
7
7
 
8
8
  def initialize(assembly)
9
9
  @assembly = assembly
@@ -4,7 +4,7 @@ class Propshaft::LoadPath
4
4
  attr_reader :paths, :version
5
5
 
6
6
  def initialize(paths = [], version: nil)
7
- @paths = Array(paths).collect { |path| Pathname.new(path) }
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
@@ -1,3 +1,3 @@
1
1
  module Propshaft
2
- VERSION = "0.6.1"
2
+ VERSION = "0.6.3"
3
3
  end
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.1
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-10 00:00:00.000000000 Z
11
+ date: 2022-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack