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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3b4320db1228b252e0ec23254e663d9814219859
4
- data.tar.gz: be9dc86758d73abff8b65e1f0551a0b87d3e7d0e
3
+ metadata.gz: 93510983ef84f8e4da72f8d757ade4ec9c696446
4
+ data.tar.gz: 0cd06fb83378381a7aef73ed4681be5567d75864
5
5
  SHA512:
6
- metadata.gz: cb2afa7f6bcbb7170a5bd8643fcb1e265325acef96b0556010dff0e881e436a678b3db3a9882067457b66c76ef1fc6ce944d898c7b998a6ac77b5d5a475683f2
7
- data.tar.gz: 85456b448b69026c6ab90ac67f0f7b8d77f6eb509cffcc00c8104164a7013dc05582b8565ed6a4fe797d2d97aaf9e220c7c5f9ff9ac5c3c05584d57bfdb282ff
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
- #### `get_styles(content_type, *optional_options)`
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
- #### `get_processors(content_type, *optional_options)`
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: `[]`
@@ -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
- if styles
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
 
@@ -1,3 +1,3 @@
1
1
  module PaperclipUtils
2
- VERSION = '1.3.0'
2
+ VERSION = '1.3.1'
3
3
  end
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.0
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-13 00:00:00.000000000 Z
11
+ date: 2016-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: paperclip