thorsson_carrierwave 0.4.9 → 0.4.10
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/carrierwave.rb +13 -1
- metadata +2 -2
data/lib/carrierwave.rb
CHANGED
@@ -4,7 +4,6 @@ require 'fileutils'
|
|
4
4
|
require 'carrierwave/core_ext/blank'
|
5
5
|
require 'carrierwave/core_ext/module_setup'
|
6
6
|
require 'carrierwave/core_ext/inheritable_attributes'
|
7
|
-
require 'carrierwave/core_ext/file'
|
8
7
|
|
9
8
|
module CarrierWave
|
10
9
|
|
@@ -97,3 +96,16 @@ require File.join(File.dirname(__FILE__), "carrierwave", "orm", 'sequel') if def
|
|
97
96
|
# ActiveRecord still used, mongomapper is used for cache
|
98
97
|
#require File.join(File.dirname(__FILE__), "carrierwave", "orm", "mongomapper") if defined?(MongoMapper)
|
99
98
|
require File.join(File.dirname(__FILE__), "carrierwave", "orm", "mongoid") if defined?(Mongoid)
|
99
|
+
|
100
|
+
|
101
|
+
class File
|
102
|
+
def size
|
103
|
+
File.size(path)
|
104
|
+
end
|
105
|
+
|
106
|
+
def empty?
|
107
|
+
size == 0
|
108
|
+
rescue Errno::ENOENT
|
109
|
+
false
|
110
|
+
end
|
111
|
+
end
|