Sha256: 127c89450b9b60157b53deb0458935f2fc26033beb04b7b54c9da159428549d7

Contents?: true

Size: 778 Bytes

Versions: 2

Compression:

Stored size: 778 Bytes

Contents

require "cardboard/engine"

module Cardboard
  autoload :Application,              'cardboard/application'

  class << self

    attr_accessor :application, :resource_controllers

    def application
      @application ||= ::Cardboard::Application.new
    end

    def user_class
      return false unless application.user_class
      @user_class ||= application.user_class.to_s.camelize.constantize
    end

    def set_resource_controllers
      Dir[Rails.root.join('app/controllers/cardboard/*_controller.rb')].map.each do |controller|
        require_dependency controller
      end
      Cardboard.resource_controllers = Cardboard::ResourceController.descendants
    end

    # Gets called within the initializer
    def setup
      yield(application)
    end
  end

end


Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cardboard_cms-0.1.6 lib/cardboard_cms.rb
cardboard_cms-0.1.4 lib/cardboard_cms.rb