public
Rubygem
Description: Resource-oriented open source Ruby framework for Web apps.
Homepage: http://rubywaves.com/
Clone URL: git://github.com/dyoder/waves.git
Search Repo:
Streamlined path generation slightly and added convenience method for 
referencing other resources from within a resource.
dyoder (author)
Tue Jul 22 18:27:32 -0700 2008
commit  5c6d0bc646a52201f3c3299441bb8bcb9c9898e0
tree    10a3f2c08b47ee7df136d20d315ea7ffae9e9b23
parent  a952d86ac8b71aceb4765988f7da8c9a780cc9bd
...
6
7
8
9
10
11
 
12
13
14
15
16
17
18
19
 
 
20
21
 
22
23
24
...
6
7
8
 
 
 
9
10
11
12
13
14
 
 
 
15
16
17
 
18
19
20
21
0
@@ -6,19 +6,16 @@ module Waves
0
       
0
       include Functor::Method
0
 
0
- def initialize( resource )
0
- @resource = resource
0
- end
0
+ def initialize( resource ) ; @resource = resource ; end
0
 
0
       functor( :generate, Array, Array ) { | keys, vals | '/' + keys.map { |key| generate( key, vals ) }.compact.join('/') }
0
       functor( :generate, :resource, Array ) { | key, vals | @resource.singular }
0
       functor( :generate, :resources, Array ) { | key, vals | @resource.plural }
0
 
0
- functor( :generate, Symbol, Array ) { | key, vals | generate( key, vals.shift ) }
0
- functor( :generate, Symbol, Symbol ) { | key, val | val.to_s }
0
- functor( :generate, Symbol, String ) { | key, val | val }
0
+ functor( :generate, Symbol, Array ) { | key, vals | generate( vals.shift ) }
0
+ functor( :generate, Regexp, Array ) { | key, vals | generate( vals.shift ) }
0
 
0
- functor( :generate, Regexp, Array ) { | key, vals | generate( key, vals.shift ) }
0
+ functor( :generate, Object ) { | key, val | val.to_s }
0
 
0
       functor( :generate, Hash, Array ) { | h, vals | vals.shift or h.values.first }
0
       
...
7
8
9
 
10
11
12
...
24
25
26
 
 
27
28
29
...
7
8
9
10
11
12
13
...
25
26
27
28
29
30
31
32
0
@@ -7,6 +7,7 @@ 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
@@ -24,6 +25,8 @@ 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
       

Comments

    No one has commented yet.