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 +4 -4
- data/README.md +9 -4
- data/VERSION +1 -1
- data/lib/paperclip/processors/deflater.rb +6 -3
- data/lib/paperclip/processors/gzip.rb +6 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59e4320f6618b26ff502f1996507a364be982d00
|
4
|
+
data.tar.gz: 555d6f96c2d55e879f6c1626ca37c27032ba36bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
27
|
-
|
28
|
-
|
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.
|
1
|
+
0.0.7
|
@@ -15,9 +15,12 @@ module Paperclip
|
|
15
15
|
strategy = @deflate_options[:strategy]
|
16
16
|
|
17
17
|
dst = create_tempfile
|
18
|
-
|
19
|
-
|
20
|
-
|
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
|
-
|
17
|
-
|
18
|
-
|
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.
|
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-
|
11
|
+
date: 2014-11-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: paperclip
|