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
updated a few rdocs; moved Kernel#debugger to utilties
automatthew (author)
Tue Aug 19 13:07:11 -0700 2008
commit  02504c4b1b5ee43380989e259cb0925efb4e8105
tree    7e9755c25509f5186461cbe050a57ee006cbea85
parent  eea9ada7524e1668a62c6492b797a11f9ebe3454
...
1
2
3
 
4
5
6
...
1
2
 
3
4
5
6
0
@@ -1,6 +1,6 @@
0
 module Waves
0
 
0
- module Dispatchers
0
+ module Dispatchers #:nodoc:
0
 
0
     # A NotFoundError means what you think it means. The dispatchers included with Waves do not
0
     # natively intercept this exception. Instead an exception handler must be registered in the application
...
23
24
25
26
27
28
 
 
 
 
 
29
30
31
...
23
24
25
 
 
 
26
27
28
29
30
31
32
33
0
@@ -23,9 +23,11 @@ module Waves
0
 
0
     class Default < Base
0
 
0
- # All dispatchers using the Dispatchers::Base to provide thread-safety, logging, etc.
0
- # must provide a +safe+ method to handle creating a response from a request.
0
- # Takes a Waves::Request and returns a Waves::Reponse
0
+ # Takes a Waves::Request and returns a Waves::Response, reloading the reloadable application constants
0
+ # if Waves.debug? is true. +safe+ processes the request by searching the application mappings for an action,
0
+ # as well as any matching :before and :after filters. If an exception is raised during the processing,
0
+ # +safe+ looks for an exception handler in the mappings. After processing the filters, action, and any
0
+ # exception handlers, the method evaluates any :always filters that matched the request.
0
       def safe( request )
0
 
0
         response = request.response
...
10
11
12
 
 
 
 
 
 
 
13
14
15
...
10
11
12
13
14
15
16
17
18
19
20
21
22
0
@@ -10,6 +10,13 @@ module Waves
0
       
0
       def initialize( options ) ; @pattern = options[ :path ] ; end
0
       
0
+ # A pattern-matching method provided by the power of Functor. Most external calls to +match+
0
+ # will start with an instance of Waves::Request.
0
+ def match(request)
0
+ # stub for RDoc
0
+ # gets overwritten by Functor
0
+ end
0
+
0
       functor( :match, Waves::Request ) { | request | match( @pattern, request.path ) }
0
       # when the pattern array is omitted, match on any path
0
       functor( :match, nil, String ) { |pattern, path| {} }
...
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
...
56
57
58
59
 
60
61
62
 
63
64
65
66
67
 
68
69
70
...
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
...
52
53
54
 
55
56
57
 
58
59
60
61
62
 
63
64
65
66
0
@@ -1,37 +1,33 @@
0
 # See the README for an overview.
0
 module Waves
0
   
0
- # this is temporay until the applications "array" becomes a hash
0
+ # A temporary measure until the applications "array" becomes a hash.
0
+ # Currently used to keep track of all loaded Waves applications.
0
   class Applications < Array
0
     def []( name ) ; self.find { |app| app.name == name.to_s.camel_case } ; end
0
   end
0
-
0
- class << self
0
-
0
- # Access the principal Waves application.
0
- def applications ; @applications ||= Applications.new ; end
0
 
0
- # This is being deprecated. Do not write new code against this.
0
- def application ; applications.last ; end
0
-
0
- def main ; applications.first ; end
0
-
0
- # Register a module as a Waves application.
0
- def << ( app )
0
- applications << app if Module === app
0
- end
0
+ # The list of all loaded applications
0
+ def self.applications ; @applications ||= Applications.new ; end
0
 
0
- def instance ; Waves::Runtime.instance ; end
0
+ # Deprecated. Do not write new code against this.
0
+ def self.application ; warn "Waves.application is deprecated"; applications.last ; end
0
+
0
+ # Access the principal Waves application.
0
+ def self.main ; applications.first ; end
0
+
0
+ # Register a module as a Waves application.
0
+ def self.<< ( app )
0
+ applications << app if Module === app
0
+ end
0
 
0
- def method_missing(name,*args,&block) ; instance.send(name,*args,&block) ; end
0
+ # Returns the most recently created instance of Waves::Runtime.
0
+ def self.instance ; Waves::Runtime.instance ; end
0
 
0
- end
0
+ def self.method_missing(name,*args,&block) ; instance.send(name,*args,&block) ; end
0
 
0
- # An application in Waves is anything that provides access to the Waves
0
- # runtime and the registered Waves applications. This includes both
0
- # Waves::Server and Waves::Console. Waves::Runtime is *not* the actual
0
- # application module(s) registered as Waves applications. To access the
0
- # main Waves application, you can use +Waves+.+application+.
0
+ # A Waves::Runtime takes an inert application module and gives it concrete, pokeable form.
0
+ # Waves::Server and Waves::Console are types of runtime.
0
   class Runtime
0
 
0
     class << self; attr_accessor :instance; end
0
@@ -56,15 +52,15 @@ module Waves
0
       @mode ||= @options[:mode]||:development
0
     end
0
     
0
- # Debug is true if debug is set to true in the current configuration.
0
+ # Returns true if debug was set to true in the current configuration.
0
     def debug? ; config.debug ; end
0
 
0
- # Access the current configuration. *Example:* +Waves::Server.config+
0
+ # Returns the current configuration.
0
     def config
0
       Waves.main::Configurations[ mode ]
0
     end
0
 
0
- # Access the mappings for the application.
0
+ # Returns the mappings for the application.
0
     def mapping ; Waves.main::Configurations[ :mapping ] ; end
0
 
0
     # Reload the modules specified in the current configuration.
...
1
2
3
4
5
6
7
 
 
 
 
 
 
8
9
10
...
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
0
@@ -1,10 +1,10 @@
0
-# Much love to Facets (more specifically English) for this module
0
-# http://english.rubyforge.org/
0
-# changed slightly in the hopes of one day implementing a different set
0
-# of rules for different languages
0
-# NOTE: this is NOT implemented yet.
0
-# plural and singular work directly with the English class
0
 module Waves
0
+ # Much love to Facets (more specifically English) for this module
0
+ # http://english.rubyforge.org/
0
+ # changed slightly in the hopes of one day implementing a different set
0
+ # of rules for different languages
0
+ # NOTE: this is NOT implemented yet.
0
+ # plural and singular work directly with the English class
0
   module Inflect # :nodoc:
0
     module InflectorMethods
0
       
...
1
 
2
3
4
...
1
2
3
4
5
0
@@ -1,3 +1,4 @@
0
 class Tempfile
0
+ # override method to prevent problem uploading files with Rack
0
   def ==(other) ; eql?(other) || super ; end
0
 end
0
\ No newline at end of file
...
39
40
41
 
42
43
44
...
46
47
48
49
50
51
52
...
39
40
41
42
43
44
45
...
47
48
49
 
50
51
52
0
@@ -39,6 +39,7 @@ require 'utilities/inflect'
0
 require 'utilities/proc'
0
 require 'utilities/hash'
0
 require 'utilities/tempfile'
0
+require 'utilities/kernel'
0
 # waves Runtime
0
 require 'dispatchers/base'
0
 require 'dispatchers/default'
0
@@ -46,7 +47,6 @@ require 'runtime/logger'
0
 require 'runtime/mime_types'
0
 require 'runtime/runtime'
0
 require 'runtime/console'
0
-require 'runtime/debugger'
0
 require 'runtime/server'
0
 require 'runtime/request'
0
 require 'runtime/response'

Comments

    No one has commented yet.