Sha256: 96cc1c3aafcbb3485d4f5c1f2f2f19b930209df33704bdbe474a4108995d4289

Contents?: true

Size: 1.26 KB

Versions: 4

Compression:

Stored size: 1.26 KB

Contents

require 'tilt'
require 'thor/group'
require 'padrino-core'
require 'padrino-gen'
require 'padrino-helpers'

Dir[File.dirname(__FILE__) + '/padrino-admin/*.rb'].each {|file| require file }
Dir[File.dirname(__FILE__) + '/padrino-admin/{helpers,orm,middleware,utils}/*.rb'].each {|file| require file }
Dir[File.dirname(__FILE__) + '/padrino-admin/generators/{actions,admin_app,admin_page,admin_uploader}.rb'].each {|file| require file }

##
# We need to apply Padrino::Admin::Utils::Extensions
# 
String.send(:include, Padrino::Admin::Utils::Crypt)
String.send(:include, Padrino::Admin::Utils::Literal)

##
# We need to add to Padrino::Application a +access_control+ class
# 
Padrino::Application.send(:cattr_accessor, :access_control)
Padrino::Application.send(:access_control=, Class.new(Padrino::AccessControl::Base))

##
# If CarrierWave is defined we set the root directory
# 
CarrierWave.root = Padrino.root("public") if defined?(CarrierWave)

##
# Extend Abastract Form builder
# 
Padrino::Helpers::FormBuilder::AbstractFormBuilder.send(:include, Padrino::Admin::Helpers::AbstractFormBuilder)

##
# Load our Padrino::Admin locales
# 
I18n.load_path += Dir["#{File.dirname(__FILE__)}/padrino-admin/locale/**/*.yml"]

##
# Load our databases extensions
# 
Padrino::Admin::Orm.register!

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
padrino-admin-0.7.5 lib/padrino-admin.rb
padrino-admin-0.7.4 lib/padrino-admin.rb
padrino-admin-0.7.3 lib/padrino-admin.rb
padrino-admin-0.7.2 lib/padrino-admin.rb