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.
Files changed (2) hide show
  1. data/lib/carrierwave.rb +13 -1
  2. 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
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 4
8
- - 9
9
- version: 0.4.9
8
+ - 10
9
+ version: 0.4.10
10
10
  platform: ruby
11
11
  authors:
12
12
  - Jonas Nicklas, Ivan Turkovic