paperclip-hacked 2.3.1.2 → 2.3.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/paperclip/upfile.rb +9 -1
  2. metadata +2 -2
@@ -6,7 +6,7 @@ module Paperclip
6
6
 
7
7
  # Infer the MIME-type of the file from the extension.
8
8
  def content_type
9
- type = (self.path.match(/\.(\w+)$/)[1] rescue "octet-stream").downcase
9
+ type = (self.path.match(/\.(\w+)$/)[1] rescue mime_type_fuee).downcase
10
10
  case type
11
11
  when %r"jp(e|g|eg)" then "image/jpeg"
12
12
  when %r"tiff?" then "image/tiff"
@@ -29,6 +29,14 @@ module Paperclip
29
29
  def size
30
30
  File.size(self)
31
31
  end
32
+
33
+ def mime_type_fuee
34
+ if File.respond_to?(:mime_type?)
35
+ File.mime_type?(self)
36
+ else
37
+ "octet-stream"
38
+ end
39
+ end
32
40
  end
33
41
  end
34
42
 
metadata CHANGED
@@ -6,8 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 2
7
7
  - 3
8
8
  - 1
9
- - 2
10
- version: 2.3.1.2
9
+ - 3
10
+ version: 2.3.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jon Yurek