Class: ActionFramework::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/actionframework/base.rb

Overview

Base class (in config.ru -> run ActionFramework::Base.new)

Instance Method Summary collapse

Constructor Details

#initializeBase

Returns a new instance of Base.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/actionframework/base.rb', line 10

def initialize
	@app = Rack::Builder.new do
		# Initialize ActionFramework itself
		ActionFramework::Server.current

		map '/static' do
			run Rack::File.new("static")
		end

		map '/realtime' do
			run ActionFramework::Realtime.new
		end

		use Rack::Session::Cookie, :secret => ActionFramework::Server.current.get_settings.cookie_secret
		
		use Warden::Manager do |manager|
			config = File.read('./config/auth.rb')
			manager.failure_app = ActionFramework::Server.current

					eval config
		end

      	  	# Run ActionFramework
      	  	run ActionFramework::Server.current
      	end
end

Instance Method Details

#call(env) ⇒ Object



37
38
39
# File 'lib/actionframework/base.rb', line 37

def call env
	@app.call(env)
end