sprockets 3.3.2 → 3.3.3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of sprockets might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6633bafc9b6d1b1570fa828078c0b4e60979bfe1
4
- data.tar.gz: 804e028afbdb65c793f4f11d8e6af5d2109d55e3
3
+ metadata.gz: faadf5a06d9bd72e3aea6d55c30d04dc5521b3b9
4
+ data.tar.gz: 8f383977d36ebfa7ab7033304d01bb67a95665fc
5
5
  SHA512:
6
- metadata.gz: ef28f9483212866abe219015449ea9e2f277860a8823b01ccc5898f6265848ed67d828bca494b8c8abc366efa74bb5591043eb19f07f47171bb778718c71661e
7
- data.tar.gz: e63e469b61325f97a91625197c213ec92aba3e2720027b4070c6ffd0463e5c7d4a1f09ffee2b0cd2b1c4b24d714e724558fe57467e0a73834c78af9ac6e223d1
6
+ metadata.gz: b42b6cb6a38a4301f18c419a903c3e3d352fd001067ab66a25d75e98ba091e599269d452041f0bb195190fdf60d74e077d13676c7a810889230f76442443aa0f
7
+ data.tar.gz: 5f386a5ef36a610d4a84f74283b5eeb7afa32567f47c6dab8c4ee0151d59b856d6d0995f0c7cc0de7e31fd283cad02f72c85d38aa779b023dd77a39fe9066c15
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ **3.3.3** (August 21, 2015)
2
+
3
+ * Remove more absolute paths from cache contents.
4
+
1
5
  **3.3.2** (August 19, 2015)
2
6
 
3
7
  * Fix cache contents to use relative paths instead of absolute paths.
@@ -78,8 +78,16 @@ module Sprockets
78
78
  asset[:uri] = expand_from_root(asset[:uri])
79
79
  asset[:load_path] = expand_from_root(asset[:load_path])
80
80
  asset[:filename] = expand_from_root(asset[:filename])
81
- asset[:metadata][:included].map! { |uri| expand_from_root(uri) } if asset[:metadata][:included]
82
- asset[:metadata][:dependencies].map! { |uri| uri.start_with?("file-digest://") ? expand_from_root(uri) : uri } if asset[:metadata][:dependencies]
81
+ asset[:metadata][:included].map! { |uri| expand_from_root(uri) } if asset[:metadata][:included]
82
+ asset[:metadata][:links].map! { |uri| expand_from_root(uri) } if asset[:metadata][:links]
83
+ asset[:metadata][:stubbed].map! { |uri| expand_from_root(uri) } if asset[:metadata][:stubbed]
84
+ asset[:metadata][:required].map! { |uri| expand_from_root(uri) } if asset[:metadata][:required]
85
+ asset[:metadata][:dependencies].map! { |uri| uri.start_with?("file-digest://") ? expand_from_root(uri) : uri } if asset[:metadata][:dependencies]
86
+
87
+ asset[:metadata].each_key do |k|
88
+ next unless k =~ /_dependencies\z/
89
+ asset[:metadata][k].map! { |uri| expand_from_root(uri) }
90
+ end
83
91
  end
84
92
  asset
85
93
  end
@@ -196,17 +204,39 @@ module Sprockets
196
204
  if cached_asset[:metadata]
197
205
  # Deep dup to avoid modifying `asset`
198
206
  cached_asset[:metadata] = cached_asset[:metadata].dup
199
- if cached_asset[:metadata][:included]
207
+ if cached_asset[:metadata][:included] && !cached_asset[:metadata][:included].empty?
200
208
  cached_asset[:metadata][:included] = cached_asset[:metadata][:included].dup
201
- cached_asset[:metadata][:included] = cached_asset[:metadata][:included].map {|uri| compress_from_root(uri) }
209
+ cached_asset[:metadata][:included].map! { |uri| compress_from_root(uri) }
210
+ end
211
+
212
+ if cached_asset[:metadata][:links] && !cached_asset[:metadata][:links].empty?
213
+ cached_asset[:metadata][:links] = cached_asset[:metadata][:links].dup
214
+ cached_asset[:metadata][:links].map! { |uri| compress_from_root(uri) }
215
+ end
216
+
217
+ if cached_asset[:metadata][:stubbed] && !cached_asset[:metadata][:stubbed].empty?
218
+ cached_asset[:metadata][:stubbed] = cached_asset[:metadata][:stubbed].dup
219
+ cached_asset[:metadata][:stubbed].map! { |uri| compress_from_root(uri) }
220
+ end
221
+
222
+ if cached_asset[:metadata][:required] && !cached_asset[:metadata][:required].empty?
223
+ cached_asset[:metadata][:required] = cached_asset[:metadata][:required].dup
224
+ cached_asset[:metadata][:required].map! { |uri| compress_from_root(uri) }
202
225
  end
203
226
 
204
- if cached_asset[:metadata][:dependencies]
227
+ if cached_asset[:metadata][:dependencies] && !cached_asset[:metadata][:dependencies].empty?
205
228
  cached_asset[:metadata][:dependencies] = cached_asset[:metadata][:dependencies].dup
206
229
  cached_asset[:metadata][:dependencies].map! do |uri|
207
230
  uri.start_with?("file-digest://".freeze) ? compress_from_root(uri) : uri
208
231
  end
209
232
  end
233
+
234
+ # compress all _dependencies in metadata like `sass_dependencies`
235
+ cached_asset[:metadata].each do |key, value|
236
+ next unless key =~ /_dependencies\z/
237
+ cached_asset[:metadata][key] = value.dup
238
+ cached_asset[:metadata][key].map! {|uri| compress_from_root(uri) }
239
+ end
210
240
  end
211
241
 
212
242
  # Unloaded asset and stored_asset now have a different URI
@@ -256,7 +286,7 @@ module Sprockets
256
286
  #
257
287
  # [["environment-version", "environment-paths", "processors:type=text/css&file_type=text/css",
258
288
  # "file-digest:///Full/path/app/assets/stylesheets/application.css",
259
- # "processors:type=text/css&file_type=text/css&pipeline=self",
289
+ # "processors:type=text/css&file_digesttype=text/css&pipeline=self",
260
290
  # "file-digest:///Full/path/app/assets/stylesheets"]]
261
291
  #
262
292
  # Where the first entry is a Set of dependencies for last generated version of that asset.
@@ -276,7 +306,7 @@ module Sprockets
276
306
 
277
307
  history = cache.get(key) || []
278
308
  history.each_with_index do |deps, index|
279
- deps = deps.map { |path| path.start_with?("file-digest://") ? expand_from_root(path) : path }
309
+ deps.map! { |path| path.start_with?("file-digest://") ? expand_from_root(path) : path }
280
310
  if asset = yield(deps)
281
311
  cache.set(key, history.rotate!(index)) if index > 0
282
312
  return asset
@@ -284,7 +314,7 @@ module Sprockets
284
314
  end
285
315
 
286
316
  asset = yield
287
- deps = asset[:metadata][:dependencies].map do |uri|
317
+ deps = asset[:metadata][:dependencies].dup.map! do |uri|
288
318
  uri.start_with?("file-digest://") ? compress_from_root(uri) : uri
289
319
  end
290
320
  cache.set(key, history.unshift(deps).take(limit))
@@ -1,3 +1,3 @@
1
1
  module Sprockets
2
- VERSION = "3.3.2"
2
+ VERSION = "3.3.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sprockets
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.2
4
+ version: 3.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Stephenson
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-08-19 00:00:00.000000000 Z
12
+ date: 2015-08-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack
@@ -311,7 +311,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
311
311
  version: '0'
312
312
  requirements: []
313
313
  rubyforge_project: sprockets
314
- rubygems_version: 2.4.5
314
+ rubygems_version: 2.4.5.1
315
315
  signing_key:
316
316
  specification_version: 4
317
317
  summary: Rack-based asset packaging system