sprockets 3.5.0 → 3.5.1

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: 8b7fa38f3206ba320ebf468c054262dda8eb21b1
4
- data.tar.gz: b28f04553ef0f97e2d27826f49ce9b17c7ff83a6
3
+ metadata.gz: 7dd0209b90a101e98586e5dbc8c1828fb54552e0
4
+ data.tar.gz: 4c5a23c98fba032b63f914e27eca0cafc139602f
5
5
  SHA512:
6
- metadata.gz: 7a3e8d417bd789f73e322d0f1da0bfdfc4f9542cfdbe785ecc4c71d89603caf66765de776db5b03ce93a534b1d45ad9fa9aac1c8017e91cf7bc28a309bef86d8
7
- data.tar.gz: e5ec4b5327b80ff10b3f0a3d417ef4f8f429836c5ae6779d570cbfddb576504317fb890e27afdb0a406f2ac7c7c6246d6b98ba5738b6af9b123f1a2b40a50aff
6
+ metadata.gz: 25ac8156e0bf67173e12ff95c683fe5ad7805946b8baf503e6821db164e19c7477af4fbc4384f620ff5f9cd917439a89d3ffeb2ae326f6cd582897e0162b38b2
7
+ data.tar.gz: 8d437551f99263d8b4bc636e4a3de57adff4816505d271d60e096661c06e74f0d812d67e95fb6e32f2598d5a28aa6148cc1cc8912a4799a630f288fd1623b169
@@ -1,5 +1,9 @@
1
1
  **Master**
2
2
 
3
+ **3.5.1** (December 5, 2015)
4
+
5
+ * Fix gzip asset generation for assets already on disk.
6
+
3
7
  **3.5.0** (December 3, 2015)
4
8
 
5
9
  * Reintroduce Gzip file generation for non-binary assets.
@@ -202,13 +202,16 @@ module Sprockets
202
202
  logger.debug "Skipping #{target}.gz, already exists"
203
203
  else
204
204
  logger.info "Writing #{target}.gz"
205
- concurrent_compressors << Concurrent::Future.execute { write_file.wait; gzip.compress(target) }
205
+ concurrent_compressors << Concurrent::Future.execute do
206
+ write_file.wait! if write_file
207
+ gzip.compress(target)
208
+ end
206
209
  end
207
210
 
208
211
  end
209
- concurrent_writers.each(&:wait)
210
- concurrent_compressors.each(&:wait)
211
- Concurrent::Future.execute { self.save }.wait
212
+ concurrent_writers.each(&:wait!)
213
+ concurrent_compressors.each(&:wait!)
214
+ save
212
215
 
213
216
  filenames
214
217
  end
@@ -4,7 +4,6 @@ module Sprockets
4
4
  # Private: Generates a gzipped file based off of reference file.
5
5
  def initialize(asset)
6
6
  @content_type = asset.content_type
7
- @mtime = asset.mtime
8
7
  @source = asset.source
9
8
  @charset = asset.charset
10
9
  end
@@ -42,11 +41,14 @@ module Sprockets
42
41
  #
43
42
  # Returns nothing.
44
43
  def compress(target)
44
+ mtime = PathUtils.stat(target).mtime
45
45
  PathUtils.atomic_write("#{target}.gz") do |f|
46
46
  gz = Zlib::GzipWriter.new(f, Zlib::BEST_COMPRESSION)
47
- gz.mtime = @mtime.to_i
47
+ gz.mtime = mtime
48
48
  gz.write(@source)
49
49
  gz.close
50
+
51
+ File.utime(mtime, mtime, f.path)
50
52
  end
51
53
 
52
54
  nil
@@ -1,3 +1,3 @@
1
1
  module Sprockets
2
- VERSION = "3.5.0"
2
+ VERSION = "3.5.1"
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.5.0
4
+ version: 3.5.1
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-12-03 00:00:00.000000000 Z
12
+ date: 2015-12-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack