GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Rubygem
Description: Resource-oriented open source Ruby framework for Web apps.
Homepage: http://rubywaves.com/
Clone URL: git://github.com/dyoder/waves.git
Removed ripped Rails helpers. Moved numeric formatting support to 
utilities. Got rid of Object monkeypatch to require explicit include for 
Attributes. Modified constraints to support blocks.
dyoder (author)
Tue Jul 22 17:04:56 -0700 2008
commit  83a577132ff17d652e09d16a73c4f197d4f93625
tree    cbb4e70dfb2a77d3fbd4c104d2ae09e7417ea0ce
parent  1c178d986d6c00f47432a308c70ef2b5ee2c5557
...
18
19
20
 
 
 
 
21
22
23
 
24
25
26
27
28
 
29
30
31
...
18
19
20
21
22
23
24
25
26
 
27
28
29
30
31
 
32
33
34
35
0
@@ -18,14 +18,18 @@ module Waves
0
     #
0
     module Model
0
 
0
+ def model( name )
0
+ Waves.application.models[ name ]
0
+ end
0
+
0
       # Just like model.all. Returns all the instances of that model.
0
       def all( model )
0
- Waves.application.models[ model ].all( domain )
0
+ model( model ).all( domain )
0
       end
0
 
0
       # Finds a specific instance using the name field
0
       def find( model, name )
0
- Waves.application.models[ model ][ :name => name ] rescue nil
0
+ model( model )[ :name => name ] rescue nil
0
       end
0
 
0
     end
...
16
17
18
19
 
20
21
22
...
16
17
18
 
19
20
21
22
0
@@ -16,7 +16,7 @@ module Waves
0
         METHODS.all? do | method |
0
           wanted = instance_variable_get( "@#{method}")
0
           got = request.send( method ) if wanted
0
- wanted === got
0
+ wanted.is_a? Proc ? wanted.call( got ) : wanted === got
0
         end
0
       end
0
             
...
45
46
47
48
49
50
51
52
53
54
55
...
45
46
47
 
 
 
 
48
 
 
49
0
@@ -45,10 +45,4 @@ module Attributes
0
   
0
   alias_method :to_hash, :to_h
0
   
0
- class Object
0
- include Attributes
0
- end
0
-
0
 end
0
-
0
-
0
\ No newline at end of file
...
15
16
17
 
 
 
18
19
20
...
15
16
17
18
19
20
21
22
23
0
@@ -15,6 +15,9 @@ module Waves
0
       def exabytes ; self * 1024.petabytes ; end
0
       def zettabytes ; self * 1024.exabytes ; end
0
       def yottabytes ; self * 1024.zettabytes ; end
0
+ def to_delimited(delim=',')
0
+ self.to_s.gsub(/(\d)(?=(\d\d\d)+$)/, "\\1#{delim}")
0
+ end
0
     end
0
   end
0
 end

Comments

    No one has commented yet.