moomerman-rambo 0.4.9 → 0.4.10
Sign up to get free protection for your applications and to get access to all the features.
- data/README +2 -0
- data/lib/rambo/controller/redirect.rb +2 -1
- data/lib/rambo/controller.rb +8 -0
- data/lib/rambo/server.rb +5 -3
- metadata +1 -1
data/README
CHANGED
data/lib/rambo/controller.rb
CHANGED
@@ -12,6 +12,10 @@ module Rambo
|
|
12
12
|
include Params
|
13
13
|
include Redirect
|
14
14
|
|
15
|
+
def rendered?
|
16
|
+
@rendered
|
17
|
+
end
|
18
|
+
|
15
19
|
def controller
|
16
20
|
self.request.controller
|
17
21
|
end
|
@@ -20,5 +24,9 @@ module Rambo
|
|
20
24
|
self.request.action
|
21
25
|
end
|
22
26
|
|
27
|
+
def session
|
28
|
+
request.env['rack.session'] ||= {}
|
29
|
+
end
|
30
|
+
|
23
31
|
end
|
24
32
|
end
|
data/lib/rambo/server.rb
CHANGED
@@ -32,14 +32,16 @@ module Rambo
|
|
32
32
|
end
|
33
33
|
obj.request = request
|
34
34
|
obj.response = response
|
35
|
-
|
35
|
+
|
36
|
+
obj.init if obj.respond_to? :init
|
37
|
+
|
36
38
|
#begin
|
37
|
-
result = obj.send(request.action)
|
39
|
+
result = obj.send(request.action) unless obj.rendered?
|
38
40
|
#rescue Exception => e
|
39
41
|
#return [404, response.header, "<h1>Action #{request.action} Not Found</h1>"]
|
40
42
|
#end
|
41
43
|
response.body = result if result
|
42
|
-
|
44
|
+
|
43
45
|
[response.status, response.header, response.body]
|
44
46
|
rescue Exception => e
|
45
47
|
puts e.message
|