paperclip-deflater 0.0.6 → 0.0.7

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
  SHA1:
3
- metadata.gz: 62a7edab5ae0d0d3ce41e5ab5926bd0cad5e252c
4
- data.tar.gz: 8bb263645637c62b0dd8bcfb0b7167bb8dd8d739
3
+ metadata.gz: 59e4320f6618b26ff502f1996507a364be982d00
4
+ data.tar.gz: 555d6f96c2d55e879f6c1626ca37c27032ba36bb
5
5
  SHA512:
6
- metadata.gz: 418f0372d984321f9755ef738e764d63f4d15f38cae06faf9cfe1d4724f4fdea59150e20d747f1231fa27bd90be93689e0e4dabb86e67b3702150b9164c2ecb5
7
- data.tar.gz: 5dc9eff4681ad9f2aa070b73625de5d37cec486308455a25c2ffb9b32c65ca3b7e117d0ce5c95789de41e229324cb02bb361920c5dd891be28f2d2e0a257a168
6
+ metadata.gz: 0d71aac5ac97bc8c941fc19b552a16d1801ffba85c8bb8c9b49b4fba9c54332b70a2c27e174344402487ae587969311cfcaa9266c96c74032fdb229fab9b19bb
7
+ data.tar.gz: 001a447113b7f16de21b7f2bfcf92a8b292f7eed6e11333eb89c325081bd4895313f2441ce84263804260f4bada337b9c4efd229e93e3f23ffb276b9f1d5f9cd
data/README.md CHANGED
@@ -21,11 +21,16 @@ And run `bundle install`.
21
21
  ## Setup
22
22
 
23
23
  ```ruby
24
- class Something
24
+ class Something < ActiveRecord::Base
25
25
  has_attached_file :js,
26
- s3_metadata: { content_encoding: 'gzip' },
27
- styles: { gzip: {processors: [:gzip], format: '.gz'} },
28
- path: "test/:id.:extension:format"
26
+ styles: {
27
+ gzip: {
28
+ processors: [:gzip],
29
+ format: 'js.gz',
30
+ s3_headers: { content_type: 'application/javascript', content_encoding: 'gzip' },
31
+ }
32
+ },
33
+ path: "test/:id.:extension"
29
34
  end
30
35
  ```
31
36
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.6
1
+ 0.0.7
@@ -15,9 +15,12 @@ module Paperclip
15
15
  strategy = @deflate_options[:strategy]
16
16
 
17
17
  dst = create_tempfile
18
- zd = Zlib::Deflate.new(level, window_bits, memlevel, strategy)
19
- dst.write zd.deflate(@file.read)
20
- zd.close
18
+ begin
19
+ zd = Zlib::Deflate.new(level, window_bits, memlevel, strategy)
20
+ dst.write zd.deflate(@file.read)
21
+ ensure
22
+ zd.close
23
+ end
21
24
  dst.flush
22
25
  dst.rewind
23
26
 
@@ -13,9 +13,12 @@ module Paperclip
13
13
  strategy = @gzip_options[:strategy]
14
14
 
15
15
  dst = create_tempfile
16
- gz = Zlib::GzipWriter.new(dst, level, strategy)
17
- gz.write(@file.read)
18
- gz.close
16
+ begin
17
+ gz = Zlib::GzipWriter.new(dst, level, strategy)
18
+ gz.write(@file.read)
19
+ ensure
20
+ gz.close
21
+ end
19
22
  dst.open
20
23
 
21
24
  dst
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paperclip-deflater
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daisuke Taniwaki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-03 00:00:00.000000000 Z
11
+ date: 2014-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: paperclip