Sha256: d1b496e7df906fc64e68439c3997da41b38fce3007588cc0c0e150014d252bde

Contents?: true

Size: 1.18 KB

Versions: 5

Compression:

Stored size: 1.18 KB

Contents

require "warden"
require "houser"
require 'gravtastic'

require "dynamic_form"
require "braintree"

module Mtwarden
	class Engine < ::Rails::Engine
		isolate_namespace Mtwarden

		config.generators do |g|
			g.test_framework :rspec, :view_specs => false
		end

		initializer "mtwarden.middleware.warden" do
			Rails.application.config.middleware.use Warden::Manager do |manager|
				manager.default_strategies :password
				manager.serialize_into_session do |user|
					user.id
				end

				manager.serialize_from_session do |id|
					Mtwarden::User.find(id)
				end
			end
		end

		initializer "mtwarden.middleware.fake_braintree_redirect" do
			if Rails.env.test?
				require "fake_braintree_redirect"
				Rails.application.config.middleware.insert_before \
				Warden::Manager,
				FakeBraintreeRedirect
			end
		end

		config.to_prepare do
			root = Mtwarden::Engine.root
			extenders_path = root + "app/extenders/**/*.rb"
			Dir.glob(extenders_path) do |file|
				Rails.configuration.cache_classes ? require(file) : load(file)
			end
		end

		initializer 'mtwarden.middleware.houser' do
			Rails.application.config.middleware.use Houser::Middleware,
			:class_name => 'Mtwarden::Account'
		end
	end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
mtwarden-2.2.7 lib/mtwarden/engine.rb
mtwarden-2.2.6 lib/mtwarden/engine.rb
mtwarden-2.2.5 lib/mtwarden/engine.rb
mtwarden-2.2.0 lib/mtwarden/engine.rb
mtwarden-2.1.0 lib/mtwarden/engine.rb