paperclip_utils 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/paperclip_utils.rb +1 -9
- data/lib/paperclip_utils/version.rb +1 -1
- 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: 93510983ef84f8e4da72f8d757ade4ec9c696446
|
4
|
+
data.tar.gz: 0cd06fb83378381a7aef73ed4681be5567d75864
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e68b91f79303a6c370d7c794e95e06697aa2ca3d3c6b5bdedc53013ea0ce37054334b0f3c832c0fc4653b64ba42b2f60e2bb8d3efe8a2deabdba7bdec6c027c
|
7
|
+
data.tar.gz: e725ec282233f03dd1bfde3e42bf41fa319442f1e87b6de6440c45f789b4eca709b987a8facc0d750d8cc16245123c02c3808e9db225cf3f6ddc27ee731f0766
|
data/README.md
CHANGED
@@ -44,7 +44,7 @@ end
|
|
44
44
|
# Helper Methods & Options
|
45
45
|
|
46
46
|
<br>
|
47
|
-
|
47
|
+
##### `Paperclip::Utils.get_styles(content_type, *optional_options)`
|
48
48
|
**styles** - Array - Default: `[:thumbnail]`
|
49
49
|
|
50
50
|
**fallback_styles** - Hash - Default -`{}`
|
@@ -52,7 +52,7 @@ end
|
|
52
52
|
**allowed_content_types** - Array - Default: `['application/pdf', 'image/png', 'image/x-png', 'image/gif', 'image/jpeg', 'image/pjpeg', 'image/jpg', 'image/tif, ''image/tiff', 'image/x-tiff']`
|
53
53
|
|
54
54
|
<br>
|
55
|
-
|
55
|
+
##### `Paperclip::Utils.get_processors(content_type, *optional_options)`
|
56
56
|
**processors** - Array - Default: `[:ghostscript, :thumbnail]` - Notes: Automatically includes ghostscript processor if processors includes :thumbnail which it does by default
|
57
57
|
|
58
58
|
**fallback_processors** - Array - Default: `[]`
|
data/lib/paperclip_utils.rb
CHANGED
@@ -30,15 +30,7 @@ module Paperclip
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def self.get_styles(content_type, styles: {preview: "800x600>", thumb: "100x100>"}, fallback_styles: {}, allowed_content_types: ALLOWED_CONTENT_TYPES)
|
33
|
-
|
34
|
-
if ['application/pdf','image/tiff','image/tif','image/x-tiff'].include?(content_type)
|
35
|
-
styles.each do |k,v|
|
36
|
-
styles[k] = [(v.is_a?(String) ? v : v[0]), :jpg]
|
37
|
-
end
|
38
|
-
end
|
39
|
-
else
|
40
|
-
styles = []
|
41
|
-
end
|
33
|
+
styles ||= []
|
42
34
|
return (allowed_content_types.include?(content_type) ? styles : fallback_styles)
|
43
35
|
end
|
44
36
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paperclip_utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Weston Ganger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: paperclip
|