public
Rubygem
Description: Resource-oriented open source Ruby framework for Web apps.
Homepage: http://rubywaves.com/
Clone URL: git://github.com/dyoder/waves.git
moved #resource into response mixin and #model, #view, #controller into 
mvc layer and made them all multi-app compatiable
dyoder (author)
Tue Jul 22 18:55:45 -0700 2008
commit  a8c522c7170cc0b1c33e4d69c0cfb5c4b1047ea9
tree    34ce9e5cce9ce7e22bb33abc6861b84966731c1e
parent  5c6d0bc646a52201f3c3299441bb8bcb9c9898e0
...
13
14
15
 
 
 
 
 
 
 
 
 
16
17
18
...
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
0
@@ -13,6 +13,15 @@ module Waves
0
         def app.controllers ; self::Controllers ; end
0
         def app.helpers ; self::Helpers ; end
0
         
0
+ unless ResponseMixin.public_instance_methods.include? 'model' do
0
+ Waves::ResponseMixin.module_eval do
0
+ [ :model, :view, :controller ].each do | k |
0
+ functor( k, Object ) { | name | Waves.application.send( k, name.to_s ) }
0
+ functor( k, Object, Object ) { | app, name | Waves.applications[ app.to_s ].send( k, name.to_s ) }
0
+ end
0
+ end
0
+ end
0
+
0
         app.auto_create_module( :Models ) do
0
           include AutoCode
0
           auto_create_class :Default
...
7
8
9
10
11
12
13
...
25
26
27
28
29
30
31
32
...
7
8
9
 
10
11
12
...
24
25
26
 
 
27
28
29
0
@@ -7,7 +7,6 @@ module Waves
0
       attr_reader :request
0
 
0
       include ResponseMixin
0
- include Functor::Method
0
       
0
       def self.included( target )
0
         parent = target.superclass
0
@@ -25,8 +24,6 @@ module Waves
0
       def plural ; self.class.plural ; end
0
       def redirect( path ) ; request.redirect( path ) ; end
0
       def paths ; self.class.paths ; end
0
- functor( :resource, Object, Object ) { | app, name | Waves.applications[ app.to_s ].resources[ name.to_s ] }
0
- functor( :resource, Object ) { | app, name | Waves.application.resources[ name.to_s ] }
0
       
0
     end
0
       
...
6
7
8
 
 
9
10
11
...
19
20
21
22
23
24
25
26
27
28
29
 
 
 
 
 
30
31
32
...
6
7
8
9
10
11
12
13
...
21
22
23
 
24
 
 
 
 
 
 
25
26
27
28
29
30
31
32
0
@@ -6,6 +6,8 @@ module Waves
0
   #
0
   # This mixin assumes that a @request@ accessor already exists.
0
   module ResponseMixin
0
+ include Functor::Methods
0
+
0
     # Access the response.
0
     def response; request.response; end
0
     # Access the request parameters.
0
@@ -19,14 +21,12 @@ module Waves
0
     # Access the request domain.
0
     def domain; request.domain; end
0
     # Issue a redirect for the given location.
0
- def mapping; Waves.application.mapping ; end
0
     def redirect(location, status = '302'); request.redirect(location, status); end
0
- # Access the primary application's models
0
- def models; Waves.application.models; end
0
- # Access the primary application's views
0
- def views; Waves.application.views; end
0
- # Access the primary application's controllers
0
- def controllers; Waves.application.controllers; end
0
+ # access stuff from an app
0
+ functor( :mapping ) { Waves.application.mapping }
0
+ functor( :mapping, Object ) { | app | Waves.applications[ app.to_s ].mapping }
0
+ functor( :resource, Object, Object ) { | app, name | Waves.applications[ app.to_s ].resources[ name.to_s ] }
0
+ functor( :resource, Object ) { | app, name | Waves.application.resources[ name.to_s ] }
0
     # Raise a "not found" exception.
0
     def not_found; request.not_found; end
0
     # Access the Waves::Logger.

Comments

    No one has commented yet.