Sha256: 9006c8d6c6f025647a93f99d7b7ab264b30c27a600a5025ab3870d6add93e344

Contents?: true

Size: 1.92 KB

Versions: 1

Compression:

Stored size: 1.92 KB

Contents

require "hancock/gallery/version"

if Hancock.mongoid?
  begin
    begin
      require 'glebtv-mongoid-paperclip'
    rescue LoadError
      require 'mongoid-paperclip'
    end
  rescue LoadError
    raise 'Add glebtv-mongoid-paperclip (*recommended*) or mongoid-paperclip or  in Gemfile'
  end
elsif Hancock.active_record?
  begin
    require 'paperclip'
  rescue LoadError
    raise 'Add paperclip in Gemfile'
  end
end
require 'hancock/gallery/paperclip_patch'
# require "image_optim"
# require "paperclip-optimizer"

require "ack_rails_admin_jcrop"

require "hancock/gallery/rails_admin_ext/hancock_image"

require 'hancock/gallery/configuration'
require 'hancock/gallery/engine'


module Hancock::Gallery
  include Hancock::Plugin

  autoload :Admin,  'hancock/gallery/admin'
  module Admin
    autoload :Gallery,        'hancock/gallery/admin/gallery'
    autoload :Image,          'hancock/gallery/admin/image'
    autoload :OriginalImage,  'hancock/gallery/admin/original_image'
    autoload :EmbeddedImage,  'hancock/gallery/admin/embedded_image'
  end

  module Models
    autoload :Gallery,        'hancock/gallery/models/gallery'
    autoload :Image,          'hancock/gallery/models/image'
    autoload :OriginalImage,  'hancock/gallery/models/original_image'
    autoload :EmbeddedImage,  'hancock/gallery/models/embedded_image'

    module Mongoid
      autoload :Gallery,        'hancock/gallery/models/mongoid/gallery'
      autoload :Image,          'hancock/gallery/models/mongoid/image'
      autoload :OriginalImage,  'hancock/gallery/models/mongoid/original_image'
      autoload :EmbeddedImage,  'hancock/gallery/models/mongoid/embedded_image'
    end

    module ActiveRecord
      autoload :Gallery,        'hancock/gallery/models/active_record/gallery'
      autoload :Image,          'hancock/gallery/models/active_record/image'
      # autoload :OriginalImage,  'hancock/gallery/models/active_record/original_image'
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hancock_cms_gallery-1.0.2 lib/hancock_cms_gallery.rb