moomerman-rambo 0.4.9 → 0.4.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README CHANGED
@@ -28,3 +28,5 @@ Features:
28
28
  = Request caching built in
29
29
  = fast static file serving
30
30
  = works with erb or haml templates (more to come)
31
+ = DataMapper integration
32
+ = Library only 60k
@@ -5,7 +5,8 @@ module Redirect
5
5
  destination = "/#{self.controller}/#{destination}"
6
6
  end
7
7
  #puts "redirecting to #{destination}"
8
-
8
+
9
+ @rendered = true
9
10
  response.status = 302
10
11
  response.header['Location'] = destination
11
12
  return ""
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moomerman-rambo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.9
4
+ version: 0.4.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Taylor