paperclip-deflater 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -5
- data/VERSION +1 -1
- data/lib/paperclip/processors/deflater.rb +1 -3
- data/lib/paperclip/processors/deflater_base.rb +1 -6
- data/lib/paperclip/processors/gzip.rb +1 -3
- data/spec/paperclip/processors/deflater_base_spec.rb +2 -10
- data/spec/paperclip/processors/deflater_spec.rb +1 -1
- data/spec/paperclip/processors/gzip_spec.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b196a7dc955a47503b40b8cbf9216465c30b7f56
|
4
|
+
data.tar.gz: fb8631f41ee2bb5252b2fb82e37137ebb9219bb3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c0661ca417643b37acf5b66a74947d70ad43ebfa62700716f22515a7db875d6d64329f47abaaa835e6eed2a697747bd7a358e9612a21c2cfb87139003054ab3
|
7
|
+
data.tar.gz: e2de539fa82076db90a64c1eefe5949f2f36c84f4c2dafedbbfd0f68806e1ef2c817b19deee6d9b98905d65fe410c69d731aa5bf64cfe284a632b7f6d59115cb
|
data/README.md
CHANGED
@@ -24,15 +24,11 @@ And run `bundle install`.
|
|
24
24
|
class Something
|
25
25
|
has_attached_file :js,
|
26
26
|
s3_metadata: { content_encoding: 'gzip' },
|
27
|
-
styles: { gzip: {processors: [:
|
27
|
+
styles: { gzip: {processors: [:gzip], format: '.gz'} },
|
28
28
|
path: "test/:id.:extension:format"
|
29
29
|
end
|
30
30
|
```
|
31
31
|
|
32
|
-
## Per instance turn-off flag
|
33
|
-
|
34
|
-
If the instance (`xx`) has `xx_no_deflate` method and it returns `true`, you can disable the deflating for the attachment.
|
35
|
-
|
36
32
|
## Contributing
|
37
33
|
|
38
34
|
1. Fork it
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.4
|
@@ -13,16 +13,11 @@ module Paperclip
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def make
|
16
|
-
|
17
|
-
make_impl
|
16
|
+
raise NotImplementedError
|
18
17
|
end
|
19
18
|
|
20
19
|
private
|
21
20
|
|
22
|
-
def make_impl
|
23
|
-
raise NotImplementedError
|
24
|
-
end
|
25
|
-
|
26
21
|
def create_tempfile
|
27
22
|
f = Tempfile.new([@basename, @format ? ".#{@format}" : ''])
|
28
23
|
f.binmode
|
@@ -10,19 +10,11 @@ describe Paperclip::Processors::DeflaterBase do
|
|
10
10
|
allow(attachment).to receive(:instance_read).with(:no_deflate).and_return(no_deflate)
|
11
11
|
end
|
12
12
|
describe "#make" do
|
13
|
-
|
14
|
-
|
15
|
-
it "returns original" do
|
16
|
-
expect(subject.make).to eq(file)
|
17
|
-
end
|
13
|
+
it "raises an exception" do
|
14
|
+
expect{ subject.make }.to raise_error(NotImplementedError)
|
18
15
|
end
|
19
16
|
end
|
20
17
|
describe "private methods" do
|
21
|
-
describe "#make_impl" do
|
22
|
-
it "raises an exception" do
|
23
|
-
expect{ subject.send(:make_impl) }.to raise_error(NotImplementedError)
|
24
|
-
end
|
25
|
-
end
|
26
18
|
describe "create_tempfile" do
|
27
19
|
it "returns a tempfile" do
|
28
20
|
f = subject.send(:create_tempfile)
|
@@ -10,7 +10,7 @@ describe Paperclip::Processors::Deflater do
|
|
10
10
|
allow(attachment).to receive(:instance_read).with(:no_deflate)
|
11
11
|
end
|
12
12
|
describe "private methods" do
|
13
|
-
describe "#
|
13
|
+
describe "#make" do
|
14
14
|
shared_examples "deflate" do
|
15
15
|
it "deflates the file" do
|
16
16
|
dst = subject.make
|
@@ -10,7 +10,7 @@ describe Paperclip::Processors::Gzip do
|
|
10
10
|
allow(attachment).to receive(:instance_read).with(:no_deflate)
|
11
11
|
end
|
12
12
|
describe "private methods" do
|
13
|
-
describe "#
|
13
|
+
describe "#make" do
|
14
14
|
shared_examples "deflate" do
|
15
15
|
it "deflates the file" do
|
16
16
|
dst = subject.make
|