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
beginning refit of sample blog
automatthew (author)
Sun Sep 21 13:34:31 -0700 2008
commit  11ca17d0f1c534779eba7102de74b0bf0e6f0b16
tree    1d1a5ba36414c6ddc322b25d2cd0b8eabecbfc63
parent  fa964ade5c5db00bd79064b967f25ead35d77866
...
2
3
4
5
6
7
8
9
10
11
 
 
12
13
14
15
...
2
3
4
 
 
 
 
 
 
 
5
6
7
8
9
10
0
@@ -2,13 +2,8 @@ module Blog
0
   module Configurations
0
     class Default < Waves::Configurations::Default
0
       
0
- resources do
0
-
0
- mount :entry, :path => [ 'entry' ]
0
- mount :entry, [ 'entry', { :rest => true } ]
0
-
0
- end
0
-
0
+ resource Blog::Resources::Map
0
+
0
     end
0
   end
0
 end
0
\ No newline at end of file
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
 
 
 
 
20
21
22
23
 
 
24
25
26
27
28
29
30
31
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
33
34
...
1
2
3
 
 
 
 
4
 
 
 
 
 
 
 
 
 
 
 
5
6
7
8
9
10
 
 
11
12
13
14
 
 
 
 
 
 
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
0
@@ -1,34 +1,45 @@
0
 module Blog
0
   module Resources
0
     class Entry < Default
0
-
0
- on :get, :list => [ ] do
0
- view.list( plural => controller.all )
0
- end
0
 
0
- on :get, :show => [ :name ] do
0
- view.show( singular => controller.find( query.name ) )
0
- end
0
-
0
- on :get, :edit => [ :name, 'edit' ] do
0
- view.edit( singular => controller.find( query.name ) )
0
- end
0
-
0
- on :put, :update => [ :name ] do
0
- controller.update( query.name )
0
- redirect "/entry/#{query.name}"
0
+ raise "got to resource"
0
+
0
+ on :get, :list => [ ] do
0
+ raise "list"
0
       end
0
       
0
- on :post, :create => [ ] do
0
- redirect "/entry/#{controller.create.name}/edit"
0
+ on :get, :show => [ :name ] do
0
+ raise "show: #{captured.name}"
0
       end
0
       
0
- on :post, :comment => [ :name ] do
0
- entry = controller.find( query.name )
0
- comment = Models::Comment.create( query.comment.to_hash )
0
- entry.add_comment( comment )
0
- redirect request.path
0
- end
0
+ #
0
+ # on :get, :list => [ ] do
0
+ # view.list( plural => controller.all )
0
+ # end
0
+ #
0
+ # on :get, :show => [ :name ] do
0
+ # view.show( singular => controller.find( query.name ) )
0
+ # end
0
+ #
0
+ # on :get, :edit => [ :name, 'edit' ] do
0
+ # view.edit( singular => controller.find( query.name ) )
0
+ # end
0
+ #
0
+ # on :put, :update => [ :name ] do
0
+ # controller.update( query.name )
0
+ # redirect "/entry/#{query.name}"
0
+ # end
0
+ #
0
+ # on :post, :create => [ ] do
0
+ # redirect "/entry/#{controller.create.name}/edit"
0
+ # end
0
+ #
0
+ # on :post, :comment => [ :name ] do
0
+ # entry = controller.find( query.name )
0
+ # comment = Models::Comment.create( query.comment.to_hash )
0
+ # entry.add_comment( comment )
0
+ # redirect request.path
0
+ # end
0
       
0
     end
0
   end
...
1
2
3
4
5
6
7
 
8
...
 
 
 
 
 
 
1
2
3
0
@@ -1,6 +1 @@
0
-WAVES = File.join(File.dirname(__FILE__), "..", "..")
0
-lambda {
0
- waves = ( ( WAVES if defined? WAVES ) || ENV['WAVES'] || File.join(File.dirname(__FILE__), 'waves') )
0
- $:.unshift(File.join( waves, "lib" )) if File.exist? waves
0
-}.call
0
-require 'waves'
0
\ No newline at end of file
0
+require 'lib/application.rb'
0
\ No newline at end of file

Comments

    No one has commented yet.