Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Monkeypatch around Datamapper's evil core exts

  • Loading branch information...
commit c468ccfcb92b5e9e137db8bfe967db20d53b4e71 1 parent cddb01f
@jnicklas jnicklas authored
Showing with 12 additions and 0 deletions.
  1. +1 −0  lib/carrierwave.rb
  2. +11 −0 lib/carrierwave/core_ext/file.rb
View
1  lib/carrierwave.rb
@@ -4,6 +4,7 @@
require 'carrierwave/core_ext/blank'
require 'carrierwave/core_ext/module_setup'
require 'carrierwave/core_ext/inheritable_attributes'
+require 'carrierwave/core_ext/file'
module CarrierWave
View
11 lib/carrierwave/core_ext/file.rb
@@ -0,0 +1,11 @@
+class File
+ def size
+ File.size(path)
+ end
+
+ def empty?
+ size == 0
+ rescue Errno::ENOENT
+ false
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.