paperclip-compression 0.3.0 → 0.3.1
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 +8 -8
- data/lib/paperclip-compression/base.rb +22 -14
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MGNmZDUxNjczYWNmZTU0ODY2ZGJhY2FlMTFkODdmYjgxYzFjZDBjZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NDc5YWNhYmQ0NjEyNjFlOTdmMzc4MmFmZjkzNjk4MjE3NDIxYzRiNg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MGQ2NDg4MzY0NTQzYTUyMDc0ZTEyZDU1ZTQ4MjY0OGFjYzcyNmVkNGM2YmIy
|
10
|
+
MWM2ZjBlOGNjZjQ1YjA2MzE3OTEwYjQxNWEyMDdlYWUyNmYyMTc5MmUxZTI1
|
11
|
+
ZmRiODA3M2YwMTMxYjY0NzQ0NzU5MzlhODE3ZmM1ZmU4ZjYyOTU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MTZiNjE4MDVjYjczNTgyMjdkOWZkODg4YjQ5Mjc1YWJlNWYzMzdjYWZjNjM4
|
14
|
+
MmU4Yzg3M2Q4OGZkNzNjMGY0MDQ5NzM1YWJjMTBhOWFmZmQzM2FkNzM5NmMw
|
15
|
+
MzI5ZDk5MDBiZjEyMGFkNDI4ZTE1NmIyNDg1NDVhMWE1MDYzZDg=
|
@@ -16,20 +16,10 @@ module PaperclipCompression
|
|
16
16
|
protected
|
17
17
|
|
18
18
|
def init_cli_opts(type, default_opts)
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
type_opts.kind_of?(String) ? type_opts : default_opts
|
24
|
-
else
|
25
|
-
false
|
26
|
-
end
|
27
|
-
else
|
28
|
-
default_opts
|
29
|
-
end
|
30
|
-
else
|
31
|
-
default_opts
|
32
|
-
end
|
19
|
+
# use default options in the papeclip config if exists, otherwise use gem defaults.
|
20
|
+
default_opts = init_default_opts(Paperclip::Attachment.default_options, type, default_opts)
|
21
|
+
# use processor_options if exists, otherwise use defaults.
|
22
|
+
init_default_opts(@options[:processor_options], type, default_opts)
|
33
23
|
end
|
34
24
|
|
35
25
|
def command_path(command)
|
@@ -44,5 +34,23 @@ module PaperclipCompression
|
|
44
34
|
File.join(PaperclipCompression.root, 'bin', folder, command)
|
45
35
|
end
|
46
36
|
|
37
|
+
private
|
38
|
+
|
39
|
+
def init_default_opts(opts, type, default_opts)
|
40
|
+
if opts && (compression_opts = opts[:compression])
|
41
|
+
if compression_opts.has_key?(type)
|
42
|
+
if (type_opts = compression_opts[type])
|
43
|
+
type_opts.kind_of?(String) ? type_opts : default_opts
|
44
|
+
else
|
45
|
+
false
|
46
|
+
end
|
47
|
+
else
|
48
|
+
default_opts
|
49
|
+
end
|
50
|
+
else
|
51
|
+
default_opts
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
47
55
|
end
|
48
56
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paperclip-compression
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- İ. Emre Kutlu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-06-
|
11
|
+
date: 2013-06-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: paperclip
|