lib/carrierwave/processing/rmagick.rb in carrierwave-0.7.1 vs lib/carrierwave/processing/rmagick.rb in carrierwave-0.8.0
- old
+ new
@@ -1,17 +1,7 @@
# encoding: utf-8
-unless defined? Magick
- begin
- require 'rmagick'
- rescue LoadError
- require 'RMagick'
- rescue LoadError
- puts "WARNING: Failed to require rmagick, image processing may fail!"
- end
-end
-
module CarrierWave
##
# This module simplifies manipulation with RMagick by providing a set
# of convenient helper methods. If you want to use them, you'll need to
@@ -67,9 +57,20 @@
#
# http://rubyforge.org/forum/forum.php?thread_id=1374&forum_id=1618
#
module RMagick
extend ActiveSupport::Concern
+
+ included do
+ begin
+ require "rmagick"
+ rescue LoadError
+ require "RMagick"
+ rescue LoadError => e
+ e.message << " (You may need to install the rmagick gem)"
+ raise e
+ end
+ end
module ClassMethods
def convert(format)
process :convert => format
end