merb 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README +22 -4
- data/Rakefile +15 -3
- data/TODO +2 -3
- data/bin/merb +61 -36
- data/examples/sample_app/dist/app/controllers/files.rb +31 -0
- data/examples/sample_app/dist/app/controllers/posts.rb +26 -2
- data/examples/sample_app/dist/app/controllers/test.rb +7 -1
- data/examples/sample_app/dist/app/views/files/progress.jerb +3 -0
- data/examples/sample_app/dist/app/views/files/start.herb +62 -0
- data/examples/sample_app/dist/app/views/files/upload.herb +6 -0
- data/examples/sample_app/dist/app/views/layout/{application.rhtml → application.herb} +2 -3
- data/examples/sample_app/dist/app/views/layout/{foo.rhtml → foo.herb} +0 -0
- data/examples/sample_app/dist/app/views/posts/{_comments.rhtml → _comments.herb} +0 -0
- data/examples/sample_app/dist/app/views/posts/comment.jerb +1 -0
- data/examples/sample_app/dist/app/views/posts/{list.rhtml → list.herb} +0 -0
- data/examples/sample_app/dist/app/views/posts/{new.rhtml → new.herb} +0 -0
- data/examples/sample_app/dist/app/views/posts/{show.rhtml → show.herb} +0 -0
- data/examples/sample_app/dist/app/views/posts/xml_test.xerb +3 -0
- data/examples/sample_app/dist/app/views/test/{foo.rhtml → foo.herb} +0 -0
- data/examples/sample_app/dist/app/views/test/{hello.rhtml → hello.herb} +0 -0
- data/examples/sample_app/dist/app/views/test/json.jerb +1 -0
- data/examples/sample_app/dist/conf/merb.yml +11 -0
- data/examples/sample_app/dist/conf/merb_init.rb +1 -1
- data/examples/sample_app/dist/conf/mup.conf +11 -0
- data/examples/sample_app/dist/public/javascripts/mup.js +113 -0
- data/examples/sample_app/script/merb_stop +7 -3
- data/examples/sample_app/script/startdrb +8 -0
- data/lib/merb.rb +37 -2
- data/lib/merb/merb_class_extensions.rb +21 -22
- data/lib/merb/merb_controller.rb +101 -33
- data/lib/merb/merb_handler.rb +26 -25
- data/lib/merb/merb_router.rb +1 -1
- data/lib/merb/merb_utils.rb +35 -37
- data/lib/merb/mixins/basic_authentication_mixin.rb +39 -0
- data/lib/merb/mixins/controller_mixin.rb +119 -115
- data/lib/merb/mixins/javascript_mixin.rb +63 -0
- data/lib/merb/mixins/render_mixin.rb +85 -69
- data/lib/merb/mixins/responder_mixin.rb +38 -0
- data/lib/merb/session/merb_drb_server.rb +107 -0
- data/lib/merb/session/merb_drb_session.rb +71 -0
- data/lib/merb/session/merb_session.rb +1 -0
- data/lib/merb/vendor/paginator/README.txt +84 -0
- data/lib/merb/vendor/paginator/paginator.rb +121 -0
- data/lib/mutex_hotfix.rb +34 -0
- metadata +41 -63
- data/doc/rdoc/classes/ControllerMixin.html +0 -676
- data/doc/rdoc/classes/Hash.html +0 -148
- data/doc/rdoc/classes/Merb.html +0 -140
- data/doc/rdoc/classes/Merb/Controller.html +0 -338
- data/doc/rdoc/classes/Merb/RouteMatcher.html +0 -388
- data/doc/rdoc/classes/Merb/Server.html +0 -148
- data/doc/rdoc/classes/Merb/Session.html +0 -201
- data/doc/rdoc/classes/Merb/SessionMixin.html +0 -199
- data/doc/rdoc/classes/MerbControllerError.html +0 -111
- data/doc/rdoc/classes/MerbHandler.html +0 -430
- data/doc/rdoc/classes/MerbHash.html +0 -469
- data/doc/rdoc/classes/MerbHash/Mutex.html +0 -198
- data/doc/rdoc/classes/Noroutefound.html +0 -153
- data/doc/rdoc/classes/Object.html +0 -149
- data/doc/rdoc/classes/RenderMixin.html +0 -362
- data/doc/rdoc/classes/String.html +0 -212
- data/doc/rdoc/classes/Symbol.html +0 -179
- data/doc/rdoc/created.rid +0 -1
- data/doc/rdoc/files/LICENSE.html +0 -129
- data/doc/rdoc/files/README.html +0 -417
- data/doc/rdoc/files/TODO.html +0 -151
- data/doc/rdoc/files/lib/merb/merb_class_extensions_rb.html +0 -101
- data/doc/rdoc/files/lib/merb/merb_controller_rb.html +0 -101
- data/doc/rdoc/files/lib/merb/merb_handler_rb.html +0 -101
- data/doc/rdoc/files/lib/merb/merb_router_rb.html +0 -101
- data/doc/rdoc/files/lib/merb/merb_utils_rb.html +0 -108
- data/doc/rdoc/files/lib/merb/mixins/controller_mixin_rb.html +0 -101
- data/doc/rdoc/files/lib/merb/mixins/render_mixin_rb.html +0 -101
- data/doc/rdoc/files/lib/merb/session/merb_session_rb.html +0 -101
- data/doc/rdoc/files/lib/merb_rb.html +0 -140
- data/doc/rdoc/files/lib/merb_tasks_rb.html +0 -101
- data/doc/rdoc/fr_class_index.html +0 -43
- data/doc/rdoc/fr_file_index.html +0 -40
- data/doc/rdoc/fr_method_index.html +0 -104
- data/doc/rdoc/index.html +0 -24
- data/doc/rdoc/rdoc-style.css +0 -208
- data/examples/sample_app/dist/app/controllers/upload.rb +0 -29
- data/examples/sample_app/dist/app/views/posts/comment.merbjs +0 -1
- data/examples/sample_app/dist/app/views/upload/start.rhtml +0 -15
- data/examples/sample_app/dist/app/views/upload/upload.rhtml +0 -4
- data/examples/sample_app/dist/public/files/README +0 -35
- data/examples/sample_app/dist/public/files/setup.rb +0 -1346
- data/examples/sample_app/log/merb.log +0 -778
|
@@ -1,388 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
-
<!DOCTYPE html
|
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
-
|
|
6
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
7
|
-
<head>
|
|
8
|
-
<title>Class: Merb::RouteMatcher</title>
|
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
11
|
-
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
|
12
|
-
<script type="text/javascript">
|
|
13
|
-
// <![CDATA[
|
|
14
|
-
|
|
15
|
-
function popupCode( url ) {
|
|
16
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function toggleCode( id ) {
|
|
20
|
-
if ( document.getElementById )
|
|
21
|
-
elem = document.getElementById( id );
|
|
22
|
-
else if ( document.all )
|
|
23
|
-
elem = eval( "document.all." + id );
|
|
24
|
-
else
|
|
25
|
-
return false;
|
|
26
|
-
|
|
27
|
-
elemStyle = elem.style;
|
|
28
|
-
|
|
29
|
-
if ( elemStyle.display != "block" ) {
|
|
30
|
-
elemStyle.display = "block"
|
|
31
|
-
} else {
|
|
32
|
-
elemStyle.display = "none"
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return true;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// Make codeblocks hidden by default
|
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
40
|
-
|
|
41
|
-
// ]]>
|
|
42
|
-
</script>
|
|
43
|
-
|
|
44
|
-
</head>
|
|
45
|
-
<body>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
<div id="classHeader">
|
|
50
|
-
<table class="header-table">
|
|
51
|
-
<tr class="top-aligned-row">
|
|
52
|
-
<td><strong>Class</strong></td>
|
|
53
|
-
<td class="class-name-in-header">Merb::RouteMatcher</td>
|
|
54
|
-
</tr>
|
|
55
|
-
<tr class="top-aligned-row">
|
|
56
|
-
<td><strong>In:</strong></td>
|
|
57
|
-
<td>
|
|
58
|
-
<a href="../../files/lib/merb/merb_router_rb.html">
|
|
59
|
-
lib/merb/merb_router.rb
|
|
60
|
-
</a>
|
|
61
|
-
<br />
|
|
62
|
-
</td>
|
|
63
|
-
</tr>
|
|
64
|
-
|
|
65
|
-
<tr class="top-aligned-row">
|
|
66
|
-
<td><strong>Parent:</strong></td>
|
|
67
|
-
<td>
|
|
68
|
-
<a href="../Object.html">
|
|
69
|
-
Object
|
|
70
|
-
</a>
|
|
71
|
-
</td>
|
|
72
|
-
</tr>
|
|
73
|
-
</table>
|
|
74
|
-
</div>
|
|
75
|
-
<!-- banner header -->
|
|
76
|
-
|
|
77
|
-
<div id="bodyContent">
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
<div id="contextContent">
|
|
82
|
-
|
|
83
|
-
<div id="description">
|
|
84
|
-
<p>
|
|
85
|
-
<a href="RouteMatcher.html">Merb::RouteMatcher</a> is the request routing
|
|
86
|
-
mapper for the merb framework. You can define placeholder parts of the url
|
|
87
|
-
with the :symbol notation. so r.add ’/foo/:bar/baz/:id’, :class
|
|
88
|
-
=> ‘Bar’, :method => ‘foo’ will match against
|
|
89
|
-
a request to /foo/123/baz/456. It will then use the class Bar as your merb
|
|
90
|
-
controller and call the foo method on it. the foo method will recieve a
|
|
91
|
-
hash with {:bar => ‘123’, :id => ‘456’} as
|
|
92
|
-
the content. So the :placeholders sections of your <a
|
|
93
|
-
href="RouteMatcher.html#M000065">routes</a> become a hash of arguments to
|
|
94
|
-
your controller methods. This route maps the default /controller/action and
|
|
95
|
-
/controller/action/id urls: r.add ’/:class/:method/:id‘
|
|
96
|
-
</p>
|
|
97
|
-
|
|
98
|
-
</div>
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
</div>
|
|
102
|
-
|
|
103
|
-
<div id="method-list">
|
|
104
|
-
<h3 class="section-bar">Methods</h3>
|
|
105
|
-
|
|
106
|
-
<div class="name-list">
|
|
107
|
-
<a href="#M000067">add</a>
|
|
108
|
-
<a href="#M000069">compile</a>
|
|
109
|
-
<a href="#M000068">compile_router</a>
|
|
110
|
-
<a href="#M000066">compiled_statement</a>
|
|
111
|
-
<a href="#M000064">new</a>
|
|
112
|
-
<a href="#M000063">prepare</a>
|
|
113
|
-
<a href="#M000065">routes</a>
|
|
114
|
-
</div>
|
|
115
|
-
</div>
|
|
116
|
-
|
|
117
|
-
</div>
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
<!-- if includes -->
|
|
121
|
-
|
|
122
|
-
<div id="section">
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
<div id="attribute-list">
|
|
129
|
-
<h3 class="section-bar">Attributes</h3>
|
|
130
|
-
|
|
131
|
-
<div class="name-list">
|
|
132
|
-
<table>
|
|
133
|
-
<tr class="top-aligned-row context-row">
|
|
134
|
-
<td class="context-item-name">sections</td>
|
|
135
|
-
<td class="context-item-value"> [RW] </td>
|
|
136
|
-
<td class="context-item-desc"></td>
|
|
137
|
-
</tr>
|
|
138
|
-
</table>
|
|
139
|
-
</div>
|
|
140
|
-
</div>
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
<!-- if method_list -->
|
|
145
|
-
<div id="methods">
|
|
146
|
-
<h3 class="section-bar">Public Class methods</h3>
|
|
147
|
-
|
|
148
|
-
<div id="method-M000067" class="method-detail">
|
|
149
|
-
<a name="M000067"></a>
|
|
150
|
-
|
|
151
|
-
<div class="method-heading">
|
|
152
|
-
<a href="#M000067" class="method-signature">
|
|
153
|
-
<span class="method-name">add</span><span class="method-args">(*route)</span>
|
|
154
|
-
</a>
|
|
155
|
-
</div>
|
|
156
|
-
|
|
157
|
-
<div class="method-description">
|
|
158
|
-
<p>
|
|
159
|
-
<a href="RouteMatcher.html#M000067">add</a> a route to be compiled
|
|
160
|
-
</p>
|
|
161
|
-
<p><a class="source-toggle" href="#"
|
|
162
|
-
onclick="toggleCode('M000067-source');return false;">[Source]</a></p>
|
|
163
|
-
<div class="method-source-code" id="M000067-source">
|
|
164
|
-
<pre>
|
|
165
|
-
<span class="ruby-comment cmt"># File lib/merb/merb_router.rb, line 44</span>
|
|
166
|
-
44: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">add</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">route</span>)
|
|
167
|
-
45: <span class="ruby-ivar">@@routes</span> <span class="ruby-operator"><<</span> [<span class="ruby-identifier">route</span>[<span class="ruby-value">0</span>], (<span class="ruby-identifier">route</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">||</span> {})]
|
|
168
|
-
46: <span class="ruby-keyword kw">end</span>
|
|
169
|
-
</pre>
|
|
170
|
-
</div>
|
|
171
|
-
</div>
|
|
172
|
-
</div>
|
|
173
|
-
|
|
174
|
-
<div id="method-M000069" class="method-detail">
|
|
175
|
-
<a name="M000069"></a>
|
|
176
|
-
|
|
177
|
-
<div class="method-heading">
|
|
178
|
-
<a href="#M000069" class="method-signature">
|
|
179
|
-
<span class="method-name">compile</span><span class="method-args">(route)</span>
|
|
180
|
-
</a>
|
|
181
|
-
</div>
|
|
182
|
-
|
|
183
|
-
<div class="method-description">
|
|
184
|
-
<p>
|
|
185
|
-
<a href="RouteMatcher.html#M000069">compile</a> each individual route into
|
|
186
|
-
a when /…/ component of the case statement. Takes /:sections if the
|
|
187
|
-
route def that start with : and turns them into placeholders for whatever
|
|
188
|
-
urls match against the route in question. Special case for the default
|
|
189
|
-
/:controller/:action/:id route.
|
|
190
|
-
</p>
|
|
191
|
-
<p><a class="source-toggle" href="#"
|
|
192
|
-
onclick="toggleCode('M000069-source');return false;">[Source]</a></p>
|
|
193
|
-
<div class="method-source-code" id="M000069-source">
|
|
194
|
-
<pre>
|
|
195
|
-
<span class="ruby-comment cmt"># File lib/merb/merb_router.rb, line 66</span>
|
|
196
|
-
66: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">compile</span>(<span class="ruby-identifier">route</span>)
|
|
197
|
-
67: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">String</span> <span class="ruby-operator">===</span> <span class="ruby-identifier">route</span>[<span class="ruby-value">0</span>]
|
|
198
|
-
68: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">route</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">'/:controller/:action/:id'</span>
|
|
199
|
-
69: <span class="ruby-keyword kw">return</span> <span class="ruby-value str">' when /\A\/([^\/;.,?]+)(?:\/?\Z|\/([^\/;.,?]+)\/?)(?:\/?\Z|\/([^\/;.,?]+)\/?)\Z/
|
|
200
|
-
70: @sections[:controller] = $1
|
|
201
|
-
71: @sections[:action] = $2 || \'index\'
|
|
202
|
-
72: @sections[:id] = $3 || nil
|
|
203
|
-
73: return @sections'</span><span class="ruby-operator"><<</span><span class="ruby-value str">"\n"</span>
|
|
204
|
-
74: <span class="ruby-keyword kw">end</span>
|
|
205
|
-
75: <span class="ruby-identifier">code</span>, <span class="ruby-identifier">count</span> = <span class="ruby-value str">''</span>, <span class="ruby-value">0</span>
|
|
206
|
-
76: <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">route</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">=~</span> <span class="ruby-ivar">@@section_regexp</span>
|
|
207
|
-
77: <span class="ruby-identifier">route</span>[<span class="ruby-value">0</span>] = <span class="ruby-identifier">route</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">dup</span>
|
|
208
|
-
78: <span class="ruby-identifier">name</span> = <span class="ruby-identifier">$1</span>
|
|
209
|
-
79: (<span class="ruby-identifier">name</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/(\*+)(\w+)/</span>) <span class="ruby-operator">?</span> (<span class="ruby-identifier">flag</span> = <span class="ruby-keyword kw">true</span>; <span class="ruby-identifier">name</span> = <span class="ruby-identifier">$2</span>) <span class="ruby-operator">:</span> (<span class="ruby-identifier">flag</span> = <span class="ruby-keyword kw">false</span>)
|
|
210
|
-
80: <span class="ruby-identifier">count</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
|
211
|
-
81: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">flag</span>
|
|
212
|
-
82: <span class="ruby-identifier">route</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">sub!</span>(<span class="ruby-ivar">@@section_regexp</span>, <span class="ruby-value str">"([^;.,?]+)"</span>)
|
|
213
|
-
83: <span class="ruby-keyword kw">else</span>
|
|
214
|
-
84: <span class="ruby-identifier">route</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">sub!</span>(<span class="ruby-ivar">@@section_regexp</span>, <span class="ruby-value str">"([^\/;.,?]+)"</span>)
|
|
215
|
-
85: <span class="ruby-keyword kw">end</span>
|
|
216
|
-
86: <span class="ruby-identifier">code</span> <span class="ruby-operator"><<</span> <span class="ruby-node">" @sections[:#{name}] = $#{count}\n"</span>
|
|
217
|
-
87: <span class="ruby-keyword kw">end</span>
|
|
218
|
-
88: <span class="ruby-identifier">condition</span> = <span class="ruby-node">" when Regexp.new('#{route[0]}')"</span>
|
|
219
|
-
89: <span class="ruby-identifier">statement</span> = <span class="ruby-node">"#{condition}\n#{code}"</span>
|
|
220
|
-
90: <span class="ruby-identifier">statement</span> <span class="ruby-operator"><<</span> <span class="ruby-node">" return #{route[1].inspect}.merge(@sections)\n"</span>
|
|
221
|
-
91: <span class="ruby-identifier">statement</span>
|
|
222
|
-
92: <span class="ruby-keyword kw">end</span>
|
|
223
|
-
</pre>
|
|
224
|
-
</div>
|
|
225
|
-
</div>
|
|
226
|
-
</div>
|
|
227
|
-
|
|
228
|
-
<div id="method-M000068" class="method-detail">
|
|
229
|
-
<a name="M000068"></a>
|
|
230
|
-
|
|
231
|
-
<div class="method-heading">
|
|
232
|
-
<a href="#M000068" class="method-signature">
|
|
233
|
-
<span class="method-name">compile_router</span><span class="method-args">()</span>
|
|
234
|
-
</a>
|
|
235
|
-
</div>
|
|
236
|
-
|
|
237
|
-
<div class="method-description">
|
|
238
|
-
<p>
|
|
239
|
-
build up a string that defines a lambda that does a case statement on the
|
|
240
|
-
PATH_INFO against each of the compiled <a
|
|
241
|
-
href="RouteMatcher.html#M000065">routes</a> in turn. first route that
|
|
242
|
-
matches wins.
|
|
243
|
-
</p>
|
|
244
|
-
<p><a class="source-toggle" href="#"
|
|
245
|
-
onclick="toggleCode('M000068-source');return false;">[Source]</a></p>
|
|
246
|
-
<div class="method-source-code" id="M000068-source">
|
|
247
|
-
<pre>
|
|
248
|
-
<span class="ruby-comment cmt"># File lib/merb/merb_router.rb, line 52</span>
|
|
249
|
-
52: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">compile_router</span>
|
|
250
|
-
53: <span class="ruby-identifier">router_lambda</span> = <span class="ruby-ivar">@@routes</span>.<span class="ruby-identifier">inject</span>(<span class="ruby-value str">"lambda{|path| \n case path\n"</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">m</span>,<span class="ruby-identifier">r</span><span class="ruby-operator">|</span>
|
|
251
|
-
54: <span class="ruby-identifier">m</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">compile</span>(<span class="ruby-identifier">r</span>)
|
|
252
|
-
55: } <span class="ruby-operator"><<</span><span class="ruby-value str">" else\n return {:controller=>'Noroutefound', :action=>'noroute'}\n end\n}"</span>
|
|
253
|
-
56: <span class="ruby-ivar">@@compiled_statement</span> = <span class="ruby-identifier">router_lambda</span>
|
|
254
|
-
57: <span class="ruby-identifier">define_method</span>(<span class="ruby-identifier">:route_request</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">eval</span>(<span class="ruby-identifier">router_lambda</span>))
|
|
255
|
-
58: <span class="ruby-keyword kw">end</span>
|
|
256
|
-
</pre>
|
|
257
|
-
</div>
|
|
258
|
-
</div>
|
|
259
|
-
</div>
|
|
260
|
-
|
|
261
|
-
<div id="method-M000064" class="method-detail">
|
|
262
|
-
<a name="M000064"></a>
|
|
263
|
-
|
|
264
|
-
<div class="method-heading">
|
|
265
|
-
<a href="#M000064" class="method-signature">
|
|
266
|
-
<span class="method-name">new</span><span class="method-args">()</span>
|
|
267
|
-
</a>
|
|
268
|
-
</div>
|
|
269
|
-
|
|
270
|
-
<div class="method-description">
|
|
271
|
-
<p>
|
|
272
|
-
init @sections for route segment recognition
|
|
273
|
-
</p>
|
|
274
|
-
<p><a class="source-toggle" href="#"
|
|
275
|
-
onclick="toggleCode('M000064-source');return false;">[Source]</a></p>
|
|
276
|
-
<div class="method-source-code" id="M000064-source">
|
|
277
|
-
<pre>
|
|
278
|
-
<span class="ruby-comment cmt"># File lib/merb/merb_router.rb, line 28</span>
|
|
279
|
-
28: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
|
|
280
|
-
29: <span class="ruby-ivar">@sections</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
|
|
281
|
-
30: <span class="ruby-keyword kw">end</span>
|
|
282
|
-
</pre>
|
|
283
|
-
</div>
|
|
284
|
-
</div>
|
|
285
|
-
</div>
|
|
286
|
-
|
|
287
|
-
<div id="method-M000063" class="method-detail">
|
|
288
|
-
<a name="M000063"></a>
|
|
289
|
-
|
|
290
|
-
<div class="method-heading">
|
|
291
|
-
<a href="#M000063" class="method-signature">
|
|
292
|
-
<span class="method-name">prepare</span><span class="method-args">() {|self| ...}</span>
|
|
293
|
-
</a>
|
|
294
|
-
</div>
|
|
295
|
-
|
|
296
|
-
<div class="method-description">
|
|
297
|
-
<p>
|
|
298
|
-
setup the router and yield it out to <a
|
|
299
|
-
href="RouteMatcher.html#M000067">add</a> <a
|
|
300
|
-
href="RouteMatcher.html#M000065">routes</a> to it. Then <a
|
|
301
|
-
href="RouteMatcher.html#M000069">compile</a> all <a
|
|
302
|
-
href="RouteMatcher.html#M000065">routes</a>
|
|
303
|
-
</p>
|
|
304
|
-
<p><a class="source-toggle" href="#"
|
|
305
|
-
onclick="toggleCode('M000063-source');return false;">[Source]</a></p>
|
|
306
|
-
<div class="method-source-code" id="M000063-source">
|
|
307
|
-
<pre>
|
|
308
|
-
<span class="ruby-comment cmt"># File lib/merb/merb_router.rb, line 20</span>
|
|
309
|
-
20: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">prepare</span>
|
|
310
|
-
21: <span class="ruby-ivar">@@routes</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
|
|
311
|
-
22: <span class="ruby-ivar">@@compiled_statement</span> = <span class="ruby-constant">String</span>.<span class="ruby-identifier">new</span>
|
|
312
|
-
23: <span class="ruby-keyword kw">yield</span> <span class="ruby-keyword kw">self</span>
|
|
313
|
-
24: <span class="ruby-identifier">compile_router</span>
|
|
314
|
-
25: <span class="ruby-keyword kw">end</span>
|
|
315
|
-
</pre>
|
|
316
|
-
</div>
|
|
317
|
-
</div>
|
|
318
|
-
</div>
|
|
319
|
-
|
|
320
|
-
<h3 class="section-bar">Public Instance methods</h3>
|
|
321
|
-
|
|
322
|
-
<div id="method-M000066" class="method-detail">
|
|
323
|
-
<a name="M000066"></a>
|
|
324
|
-
|
|
325
|
-
<div class="method-heading">
|
|
326
|
-
<a href="#M000066" class="method-signature">
|
|
327
|
-
<span class="method-name">compiled_statement</span><span class="method-args">()</span>
|
|
328
|
-
</a>
|
|
329
|
-
</div>
|
|
330
|
-
|
|
331
|
-
<div class="method-description">
|
|
332
|
-
<p>
|
|
333
|
-
the final compiled lambda that gets used as the body of the route_request
|
|
334
|
-
method.
|
|
335
|
-
</p>
|
|
336
|
-
<p><a class="source-toggle" href="#"
|
|
337
|
-
onclick="toggleCode('M000066-source');return false;">[Source]</a></p>
|
|
338
|
-
<div class="method-source-code" id="M000066-source">
|
|
339
|
-
<pre>
|
|
340
|
-
<span class="ruby-comment cmt"># File lib/merb/merb_router.rb, line 39</span>
|
|
341
|
-
39: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">compiled_statement</span>
|
|
342
|
-
40: <span class="ruby-ivar">@@compiled_statement</span>
|
|
343
|
-
41: <span class="ruby-keyword kw">end</span>
|
|
344
|
-
</pre>
|
|
345
|
-
</div>
|
|
346
|
-
</div>
|
|
347
|
-
</div>
|
|
348
|
-
|
|
349
|
-
<div id="method-M000065" class="method-detail">
|
|
350
|
-
<a name="M000065"></a>
|
|
351
|
-
|
|
352
|
-
<div class="method-heading">
|
|
353
|
-
<a href="#M000065" class="method-signature">
|
|
354
|
-
<span class="method-name">routes</span><span class="method-args">()</span>
|
|
355
|
-
</a>
|
|
356
|
-
</div>
|
|
357
|
-
|
|
358
|
-
<div class="method-description">
|
|
359
|
-
<p>
|
|
360
|
-
all defined <a href="RouteMatcher.html#M000065">routes</a> in their raw
|
|
361
|
-
form.
|
|
362
|
-
</p>
|
|
363
|
-
<p><a class="source-toggle" href="#"
|
|
364
|
-
onclick="toggleCode('M000065-source');return false;">[Source]</a></p>
|
|
365
|
-
<div class="method-source-code" id="M000065-source">
|
|
366
|
-
<pre>
|
|
367
|
-
<span class="ruby-comment cmt"># File lib/merb/merb_router.rb, line 33</span>
|
|
368
|
-
33: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">routes</span>
|
|
369
|
-
34: <span class="ruby-ivar">@@routes</span>
|
|
370
|
-
35: <span class="ruby-keyword kw">end</span>
|
|
371
|
-
</pre>
|
|
372
|
-
</div>
|
|
373
|
-
</div>
|
|
374
|
-
</div>
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
</div>
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
</div>
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
<div id="validator-badges">
|
|
384
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
385
|
-
</div>
|
|
386
|
-
|
|
387
|
-
</body>
|
|
388
|
-
</html>
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
-
<!DOCTYPE html
|
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
-
|
|
6
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
7
|
-
<head>
|
|
8
|
-
<title>Class: Merb::Server</title>
|
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
11
|
-
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
|
12
|
-
<script type="text/javascript">
|
|
13
|
-
// <![CDATA[
|
|
14
|
-
|
|
15
|
-
function popupCode( url ) {
|
|
16
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function toggleCode( id ) {
|
|
20
|
-
if ( document.getElementById )
|
|
21
|
-
elem = document.getElementById( id );
|
|
22
|
-
else if ( document.all )
|
|
23
|
-
elem = eval( "document.all." + id );
|
|
24
|
-
else
|
|
25
|
-
return false;
|
|
26
|
-
|
|
27
|
-
elemStyle = elem.style;
|
|
28
|
-
|
|
29
|
-
if ( elemStyle.display != "block" ) {
|
|
30
|
-
elemStyle.display = "block"
|
|
31
|
-
} else {
|
|
32
|
-
elemStyle.display = "none"
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return true;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// Make codeblocks hidden by default
|
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
40
|
-
|
|
41
|
-
// ]]>
|
|
42
|
-
</script>
|
|
43
|
-
|
|
44
|
-
</head>
|
|
45
|
-
<body>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
<div id="classHeader">
|
|
50
|
-
<table class="header-table">
|
|
51
|
-
<tr class="top-aligned-row">
|
|
52
|
-
<td><strong>Class</strong></td>
|
|
53
|
-
<td class="class-name-in-header">Merb::Server</td>
|
|
54
|
-
</tr>
|
|
55
|
-
<tr class="top-aligned-row">
|
|
56
|
-
<td><strong>In:</strong></td>
|
|
57
|
-
<td>
|
|
58
|
-
<a href="../../files/lib/merb_rb.html">
|
|
59
|
-
lib/merb.rb
|
|
60
|
-
</a>
|
|
61
|
-
<br />
|
|
62
|
-
</td>
|
|
63
|
-
</tr>
|
|
64
|
-
|
|
65
|
-
<tr class="top-aligned-row">
|
|
66
|
-
<td><strong>Parent:</strong></td>
|
|
67
|
-
<td>
|
|
68
|
-
<a href="../Object.html">
|
|
69
|
-
Object
|
|
70
|
-
</a>
|
|
71
|
-
</td>
|
|
72
|
-
</tr>
|
|
73
|
-
</table>
|
|
74
|
-
</div>
|
|
75
|
-
<!-- banner header -->
|
|
76
|
-
|
|
77
|
-
<div id="bodyContent">
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
<div id="contextContent">
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
</div>
|
|
86
|
-
|
|
87
|
-
<div id="method-list">
|
|
88
|
-
<h3 class="section-bar">Methods</h3>
|
|
89
|
-
|
|
90
|
-
<div class="name-list">
|
|
91
|
-
<a href="#M000078">config</a>
|
|
92
|
-
</div>
|
|
93
|
-
</div>
|
|
94
|
-
|
|
95
|
-
</div>
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
<!-- if includes -->
|
|
99
|
-
|
|
100
|
-
<div id="section">
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
<!-- if method_list -->
|
|
110
|
-
<div id="methods">
|
|
111
|
-
<h3 class="section-bar">Public Class methods</h3>
|
|
112
|
-
|
|
113
|
-
<div id="method-M000078" class="method-detail">
|
|
114
|
-
<a name="M000078"></a>
|
|
115
|
-
|
|
116
|
-
<div class="method-heading">
|
|
117
|
-
<a href="#M000078" class="method-signature">
|
|
118
|
-
<span class="method-name">config</span><span class="method-args">()</span>
|
|
119
|
-
</a>
|
|
120
|
-
</div>
|
|
121
|
-
|
|
122
|
-
<div class="method-description">
|
|
123
|
-
<p><a class="source-toggle" href="#"
|
|
124
|
-
onclick="toggleCode('M000078-source');return false;">[Source]</a></p>
|
|
125
|
-
<div class="method-source-code" id="M000078-source">
|
|
126
|
-
<pre>
|
|
127
|
-
<span class="ruby-comment cmt"># File lib/merb.rb, line 10</span>
|
|
128
|
-
10: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">config</span>
|
|
129
|
-
11: <span class="ruby-ivar">@@merb_opts</span> <span class="ruby-operator">||=</span> {}
|
|
130
|
-
12: <span class="ruby-keyword kw">end</span>
|
|
131
|
-
</pre>
|
|
132
|
-
</div>
|
|
133
|
-
</div>
|
|
134
|
-
</div>
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
</div>
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
</div>
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
<div id="validator-badges">
|
|
144
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
145
|
-
</div>
|
|
146
|
-
|
|
147
|
-
</body>
|
|
148
|
-
</html>
|