renee 0.3.11 → 0.4.0.pre1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (231) hide show
  1. data/Gemfile +17 -0
  2. data/Gemfile-renee +8 -0
  3. data/Gemfile-renee-core +8 -0
  4. data/Gemfile-renee-render +9 -0
  5. data/Gemfile-renee-session +9 -0
  6. data/Gemfile-renee-url-generation +8 -0
  7. data/MIT-LICENSE.txt +7 -0
  8. data/README-renee-core.md +242 -0
  9. data/README-renee-render.md +38 -0
  10. data/README-renee-session.md +3 -0
  11. data/README-renee-url-generation.md +3 -0
  12. data/README.md +131 -6
  13. data/Rakefile +109 -9
  14. data/TODO.txt +45 -0
  15. data/config.ru +26 -0
  16. data/examples/blog/blog.rb +3 -1
  17. data/examples/blog/config.ru +24 -19
  18. data/examples/blog/views/edit.erb +10 -1
  19. data/examples/blog/views/show.erb +5 -0
  20. data/lib/renee.rb +11 -4
  21. data/lib/renee/core.rb +98 -0
  22. data/lib/renee/core/chaining.rb +66 -0
  23. data/lib/renee/core/env_accessors.rb +72 -0
  24. data/lib/renee/core/exceptions.rb +15 -0
  25. data/lib/renee/core/matcher.rb +61 -0
  26. data/lib/renee/core/plugins.rb +31 -0
  27. data/lib/renee/core/rack_interaction.rb +50 -0
  28. data/lib/renee/core/request_context.rb +56 -0
  29. data/lib/renee/core/responding.rb +112 -0
  30. data/lib/renee/core/response.rb +78 -0
  31. data/lib/renee/core/routing.rb +319 -0
  32. data/lib/renee/core/transform.rb +18 -0
  33. data/lib/renee/render.rb +221 -0
  34. data/lib/renee/session.rb +50 -0
  35. data/lib/renee/url_generation.rb +117 -0
  36. data/lib/renee/util.rb +7 -0
  37. data/lib/renee/version.rb +2 -4
  38. data/plan.txt +19 -0
  39. data/renee-core.gemspec +26 -0
  40. data/renee-render.gemspec +30 -0
  41. data/renee-session.gemspec +28 -0
  42. data/renee-url-generation.gemspec +24 -0
  43. data/renee.gemspec +5 -6
  44. data/site/MIT-LICENSE.txt +7 -0
  45. data/site/public/css/app.css +75 -0
  46. data/site/public/docs/renee-core/Renee.html +208 -0
  47. data/site/public/docs/renee-core/Renee/Core.html +366 -0
  48. data/site/public/docs/renee-core/Renee/Core/Chaining.html +192 -0
  49. data/site/public/docs/renee-core/Renee/Core/ClassMethods.html +725 -0
  50. data/site/public/docs/renee-core/Renee/Core/ClientError.html +317 -0
  51. data/site/public/docs/renee-core/Renee/Core/EnvAccessors.html +152 -0
  52. data/site/public/docs/renee-core/Renee/Core/EnvAccessors/ClassMethods.html +354 -0
  53. data/site/public/docs/renee-core/Renee/Core/Matcher.html +675 -0
  54. data/site/public/docs/renee-core/Renee/Core/Plugins.html +475 -0
  55. data/site/public/docs/renee-core/Renee/Core/RackInteraction.html +488 -0
  56. data/site/public/docs/renee-core/Renee/Core/RequestContext.html +511 -0
  57. data/site/public/docs/renee-core/Renee/Core/Responding.html +877 -0
  58. data/site/public/docs/renee-core/Renee/Core/Response.html +691 -0
  59. data/site/public/docs/renee-core/Renee/Core/Routing.html +1589 -0
  60. data/site/public/docs/renee-core/Renee/Core/Transform.html +249 -0
  61. data/site/public/docs/renee-core/Renee/Core/URLGeneration.html +597 -0
  62. data/site/public/docs/renee-core/_index.html +244 -0
  63. data/site/public/docs/renee-core/class_list.html +47 -0
  64. data/site/public/docs/renee-core/css/common.css +1 -0
  65. data/site/public/docs/renee-core/css/full_list.css +55 -0
  66. data/site/public/docs/renee-core/css/style.css +322 -0
  67. data/site/public/docs/renee-core/file.README-renee-core.html +341 -0
  68. data/site/public/docs/renee-core/file.README.html +212 -0
  69. data/site/public/docs/renee-core/file_list.html +49 -0
  70. data/site/public/docs/renee-core/frames.html +13 -0
  71. data/site/public/docs/renee-core/index.html +341 -0
  72. data/site/public/docs/renee-core/js/app.js +205 -0
  73. data/site/public/docs/renee-core/js/full_list.js +167 -0
  74. data/site/public/docs/renee-core/js/jquery.js +16 -0
  75. data/site/public/docs/renee-core/method_list.html +590 -0
  76. data/site/public/docs/renee-core/top-level-namespace.html +103 -0
  77. data/site/public/docs/renee-render/Renee.html +116 -0
  78. data/site/public/docs/renee-render/Renee/Core.html +346 -0
  79. data/site/public/docs/renee-render/Renee/Core/Chaining.html +125 -0
  80. data/site/public/docs/renee-render/Renee/Core/ClassMethods.html +620 -0
  81. data/site/public/docs/renee-render/Renee/Core/ClientError.html +317 -0
  82. data/site/public/docs/renee-render/Renee/Core/EnvAccessors.html +152 -0
  83. data/site/public/docs/renee-render/Renee/Core/EnvAccessors/ClassMethods.html +354 -0
  84. data/site/public/docs/renee-render/Renee/Core/Matcher.html +675 -0
  85. data/site/public/docs/renee-render/Renee/Core/RackInteraction.html +488 -0
  86. data/site/public/docs/renee-render/Renee/Core/RequestContext.html +421 -0
  87. data/site/public/docs/renee-render/Renee/Core/Responding.html +873 -0
  88. data/site/public/docs/renee-render/Renee/Core/Response.html +691 -0
  89. data/site/public/docs/renee-render/Renee/Core/Routing.html +1682 -0
  90. data/site/public/docs/renee-render/Renee/Core/Transform.html +249 -0
  91. data/site/public/docs/renee-render/Renee/Core/URLGeneration.html +597 -0
  92. data/site/public/docs/renee-render/Renee/Render.html +873 -0
  93. data/site/public/docs/renee-render/Renee/Render/ClassMethods.html +382 -0
  94. data/site/public/docs/renee-render/Renee/Render/TemplateNotFound.html +126 -0
  95. data/site/public/docs/renee-render/_index.html +143 -0
  96. data/site/public/docs/renee-render/class_list.html +47 -0
  97. data/site/public/docs/renee-render/css/common.css +1 -0
  98. data/site/public/docs/renee-render/css/full_list.css +55 -0
  99. data/site/public/docs/renee-render/css/style.css +322 -0
  100. data/site/public/docs/renee-render/file.README-renee-render.html +104 -0
  101. data/site/public/docs/renee-render/file.README.html +212 -0
  102. data/site/public/docs/renee-render/file_list.html +49 -0
  103. data/site/public/docs/renee-render/frames.html +13 -0
  104. data/site/public/docs/renee-render/index.html +104 -0
  105. data/site/public/docs/renee-render/js/app.js +205 -0
  106. data/site/public/docs/renee-render/js/full_list.js +167 -0
  107. data/site/public/docs/renee-render/js/jquery.js +16 -0
  108. data/site/public/docs/renee-render/method_list.html +110 -0
  109. data/site/public/docs/renee-render/top-level-namespace.html +103 -0
  110. data/site/public/docs/renee-session/Renee.html +106 -0
  111. data/site/public/docs/renee-session/Renee/Session.html +173 -0
  112. data/site/public/docs/renee-session/Renee/Session/ClassMethods.html +470 -0
  113. data/site/public/docs/renee-session/_index.html +136 -0
  114. data/site/public/docs/renee-session/class_list.html +47 -0
  115. data/site/public/docs/renee-session/css/common.css +1 -0
  116. data/site/public/docs/renee-session/css/full_list.css +55 -0
  117. data/site/public/docs/renee-session/css/style.css +322 -0
  118. data/site/public/docs/renee-session/file.README-renee-core.html +341 -0
  119. data/site/public/docs/renee-session/file.README-renee-session.html +69 -0
  120. data/site/public/docs/renee-session/file_list.html +49 -0
  121. data/site/public/docs/renee-session/frames.html +13 -0
  122. data/site/public/docs/renee-session/index.html +69 -0
  123. data/site/public/docs/renee-session/js/app.js +205 -0
  124. data/site/public/docs/renee-session/js/full_list.js +167 -0
  125. data/site/public/docs/renee-session/js/jquery.js +16 -0
  126. data/site/public/docs/renee-session/method_list.html +102 -0
  127. data/site/public/docs/renee-session/top-level-namespace.html +103 -0
  128. data/site/public/docs/renee-url-generation/Renee.html +208 -0
  129. data/site/public/docs/renee-url-generation/Renee/Core.html +366 -0
  130. data/site/public/docs/renee-url-generation/Renee/Core/Chaining.html +192 -0
  131. data/site/public/docs/renee-url-generation/Renee/Core/ClassMethods.html +725 -0
  132. data/site/public/docs/renee-url-generation/Renee/Core/ClientError.html +317 -0
  133. data/site/public/docs/renee-url-generation/Renee/Core/EnvAccessors.html +152 -0
  134. data/site/public/docs/renee-url-generation/Renee/Core/EnvAccessors/ClassMethods.html +354 -0
  135. data/site/public/docs/renee-url-generation/Renee/Core/Matcher.html +675 -0
  136. data/site/public/docs/renee-url-generation/Renee/Core/Plugins.html +475 -0
  137. data/site/public/docs/renee-url-generation/Renee/Core/RackInteraction.html +488 -0
  138. data/site/public/docs/renee-url-generation/Renee/Core/RequestContext.html +511 -0
  139. data/site/public/docs/renee-url-generation/Renee/Core/Responding.html +877 -0
  140. data/site/public/docs/renee-url-generation/Renee/Core/Response.html +691 -0
  141. data/site/public/docs/renee-url-generation/Renee/Core/Routing.html +1589 -0
  142. data/site/public/docs/renee-url-generation/Renee/Core/Transform.html +249 -0
  143. data/site/public/docs/renee-url-generation/_index.html +244 -0
  144. data/site/public/docs/renee-url-generation/class_list.html +47 -0
  145. data/site/public/docs/renee-url-generation/css/common.css +1 -0
  146. data/site/public/docs/renee-url-generation/css/full_list.css +55 -0
  147. data/site/public/docs/renee-url-generation/css/style.css +322 -0
  148. data/site/public/docs/renee-url-generation/file.README-renee-url-generation.html +69 -0
  149. data/site/public/docs/renee-url-generation/file_list.html +49 -0
  150. data/site/public/docs/renee-url-generation/frames.html +13 -0
  151. data/site/public/docs/renee-url-generation/index.html +69 -0
  152. data/site/public/docs/renee-url-generation/js/app.js +205 -0
  153. data/site/public/docs/renee-url-generation/js/full_list.js +167 -0
  154. data/site/public/docs/renee-url-generation/js/jquery.js +16 -0
  155. data/site/public/docs/renee-url-generation/method_list.html +590 -0
  156. data/site/public/docs/renee-url-generation/top-level-namespace.html +103 -0
  157. data/site/public/docs/renee/Renee.html +232 -0
  158. data/site/public/docs/renee/Renee/Application.html +367 -0
  159. data/site/public/docs/renee/Renee/Core.html +370 -0
  160. data/site/public/docs/renee/Renee/Core/Chaining.html +192 -0
  161. data/site/public/docs/renee/Renee/Core/ClassMethods.html +725 -0
  162. data/site/public/docs/renee/Renee/Core/ClientError.html +317 -0
  163. data/site/public/docs/renee/Renee/Core/EnvAccessors.html +152 -0
  164. data/site/public/docs/renee/Renee/Core/EnvAccessors/ClassMethods.html +354 -0
  165. data/site/public/docs/renee/Renee/Core/Matcher.html +675 -0
  166. data/site/public/docs/renee/Renee/Core/Plugins.html +475 -0
  167. data/site/public/docs/renee/Renee/Core/RackInteraction.html +488 -0
  168. data/site/public/docs/renee/Renee/Core/RequestContext.html +511 -0
  169. data/site/public/docs/renee/Renee/Core/Responding.html +877 -0
  170. data/site/public/docs/renee/Renee/Core/Response.html +691 -0
  171. data/site/public/docs/renee/Renee/Core/Routing.html +1589 -0
  172. data/site/public/docs/renee/Renee/Core/Transform.html +249 -0
  173. data/site/public/docs/renee/Renee/Core/URLGeneration.html +597 -0
  174. data/site/public/docs/renee/Renee/Render.html +877 -0
  175. data/site/public/docs/renee/Renee/Render/ClassMethods.html +382 -0
  176. data/site/public/docs/renee/Renee/Render/TemplateNotFound.html +126 -0
  177. data/site/public/docs/renee/Renee/Session.html +177 -0
  178. data/site/public/docs/renee/Renee/Session/ClassMethods.html +470 -0
  179. data/site/public/docs/renee/Renee/URLGeneration.html +142 -0
  180. data/site/public/docs/renee/Renee/URLGeneration/ClassMethods.html +593 -0
  181. data/site/public/docs/renee/Renee/Util.html +163 -0
  182. data/site/public/docs/renee/_index.html +336 -0
  183. data/site/public/docs/renee/class_list.html +47 -0
  184. data/site/public/docs/renee/css/common.css +1 -0
  185. data/site/public/docs/renee/css/full_list.css +55 -0
  186. data/site/public/docs/renee/css/style.css +322 -0
  187. data/site/public/docs/renee/file.README.html +212 -0
  188. data/site/public/docs/renee/file_list.html +49 -0
  189. data/site/public/docs/renee/frames.html +13 -0
  190. data/site/public/docs/renee/index.html +212 -0
  191. data/site/public/docs/renee/js/app.js +205 -0
  192. data/site/public/docs/renee/js/full_list.js +167 -0
  193. data/site/public/docs/renee/js/jquery.js +16 -0
  194. data/site/public/docs/renee/method_list.html +758 -0
  195. data/site/public/docs/renee/top-level-namespace.html +202 -0
  196. data/site/public/img/favicon.ico +0 -0
  197. data/site/public/img/reneeclean.png +0 -0
  198. data/site/public/img/russiangithub.png +0 -0
  199. data/site/public/img/stoneposter.png +0 -0
  200. data/site/public/img/vospit.jpeg +0 -0
  201. data/site/views/chaining.md +32 -0
  202. data/site/views/index.md +219 -0
  203. data/site/views/layouts/app.haml +16 -0
  204. data/site/views/rack-integration.md +51 -0
  205. data/site/views/responding.md +103 -0
  206. data/site/views/route-generation.md +82 -0
  207. data/site/views/routing.md +261 -0
  208. data/site/views/settings.md +19 -0
  209. data/site/views/team-renee.md +13 -0
  210. data/site/views/tutorial.md +57 -0
  211. data/site/views/variable-types.md +57 -0
  212. data/test.watchr +61 -0
  213. data/test/renee-core/chaining_test.rb +33 -0
  214. data/test/renee-core/env_accessors_test.rb +43 -0
  215. data/test/renee-core/include_test.rb +14 -0
  216. data/test/renee-core/request_context_test.rb +70 -0
  217. data/test/renee-core/responding_test.rb +128 -0
  218. data/test/renee-core/routing_test.rb +443 -0
  219. data/test/renee-core/test_helper.rb +4 -0
  220. data/test/renee-core/variable_type_test.rb +57 -0
  221. data/test/renee-render/render_test.rb +162 -0
  222. data/test/renee-render/test_helper.rb +9 -0
  223. data/test/renee-session/session_test.rb +31 -0
  224. data/test/renee-session/test_helper.rb +9 -0
  225. data/test/renee-url-generation/test_helper.rb +10 -0
  226. data/test/renee-url-generation/url_generation_test.rb +63 -0
  227. data/test/{blog_test.rb → renee/blog_test.rb} +10 -5
  228. data/test/renee/test_helper.rb +56 -0
  229. data/test/test_helper.rb +23 -10
  230. metadata +333 -156
  231. data/.yardopts +0 -6
@@ -0,0 +1,1682 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Module: Renee::Core::Routing
8
+
9
+ &mdash; Documentation by YARD 0.7.3
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ relpath = '../..';
19
+ if (relpath != '') relpath += '/';
20
+ </script>
21
+
22
+ <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
25
+
26
+
27
+ </head>
28
+ <body>
29
+ <script type="text/javascript" charset="utf-8">
30
+ if (window.top.frames.main) document.body.className = 'frames';
31
+ </script>
32
+
33
+ <div id="header">
34
+ <div id="menu">
35
+
36
+ <a href="../../_index.html">Index (R)</a> &raquo;
37
+ <span class='title'><span class='object_link'><a href="../../Renee.html" title="Renee (module)">Renee</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Core.html" title="Renee::Core (class)">Core</a></span></span>
38
+ &raquo;
39
+ <span class="title">Routing</span>
40
+
41
+
42
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
43
+ </div>
44
+
45
+ <div id="search">
46
+
47
+ <a id="class_list_link" href="#">Class List</a>
48
+
49
+ <a id="method_list_link" href="#">Method List</a>
50
+
51
+ <a id="file_list_link" href="#">File List</a>
52
+
53
+ </div>
54
+ <div class="clear"></div>
55
+ </div>
56
+
57
+ <iframe id="search_frame"></iframe>
58
+
59
+ <div id="content"><h1>Module: Renee::Core::Routing
60
+
61
+
62
+
63
+ </h1>
64
+
65
+ <dl class="box">
66
+
67
+
68
+
69
+
70
+
71
+ <dt class="r1">Includes:</dt>
72
+ <dd class="r1"><span class='object_link'><a href="Chaining.html" title="Renee::Core::Chaining (module)">Chaining</a></span></dd>
73
+
74
+
75
+
76
+
77
+ <dt class="r2">Included in:</dt>
78
+ <dd class="r2"><span class='object_link'><a href="../Core.html" title="Renee::Core (class)">Renee::Core</a></span></dd>
79
+
80
+
81
+
82
+ <dt class="r1 last">Defined in:</dt>
83
+ <dd class="r1 last">lib/renee/core/routing.rb</dd>
84
+
85
+ </dl>
86
+ <div class="clear"></div>
87
+
88
+ <h2>Overview</h2><div class="docstring">
89
+ <div class="discussion">
90
+ <p>Collection of useful methods for routing within a <span class='object_link'><a href="../Core.html" title="Renee::Core (class)">Renee::Core</a></span> app.</p>
91
+
92
+
93
+ </div>
94
+ </div>
95
+ <div class="tags">
96
+
97
+
98
+ </div>
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+
111
+ <h2>
112
+ Instance Method Summary
113
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
114
+ </h2>
115
+
116
+ <ul class="summary">
117
+
118
+ <li class="public ">
119
+ <span class="summary_signature">
120
+
121
+ <a href="#allow_continued_routing-instance_method" title="#allow_continued_routing (instance method)">- (Object) <strong>allow_continued_routing</strong>(val = true) </a>
122
+
123
+
124
+
125
+ </span>
126
+
127
+
128
+
129
+
130
+
131
+
132
+
133
+
134
+ <span class="summary_desc"><div class='inline'><p>Allow continued routing if a routing block fails to match.</p>
135
+ </div></span>
136
+
137
+ </li>
138
+
139
+
140
+ <li class="public ">
141
+ <span class="summary_signature">
142
+
143
+ <a href="#complete-instance_method" title="#complete (instance method)">- (Object) <strong>complete</strong>(&amp;blk) </a>
144
+
145
+
146
+
147
+ </span>
148
+
149
+
150
+
151
+
152
+
153
+
154
+
155
+
156
+ <span class="summary_desc"><div class='inline'><p>Match only when the path is either '' or '/'.</p>
157
+ </div></span>
158
+
159
+ </li>
160
+
161
+
162
+ <li class="public ">
163
+ <span class="summary_signature">
164
+
165
+ <a href="#delete-instance_method" title="#delete (instance method)">- (Object) <strong>delete</strong>(path = nil, &amp;blk) </a>
166
+
167
+
168
+
169
+ </span>
170
+
171
+
172
+
173
+
174
+
175
+
176
+
177
+
178
+ <span class="summary_desc"><div class='inline'><p>Respond to a DELETE request and yield the block.</p>
179
+ </div></span>
180
+
181
+ </li>
182
+
183
+
184
+ <li class="public ">
185
+ <span class="summary_signature">
186
+
187
+ <a href="#empty-instance_method" title="#empty (instance method)">- (Object) <strong>empty</strong>(&amp;blk) </a>
188
+
189
+
190
+
191
+ </span>
192
+
193
+
194
+
195
+
196
+
197
+
198
+
199
+
200
+ <span class="summary_desc"><div class='inline'><p>Match only when the path is ''.</p>
201
+ </div></span>
202
+
203
+ </li>
204
+
205
+
206
+ <li class="public ">
207
+ <span class="summary_signature">
208
+
209
+ <a href="#extension-instance_method" title="#extension (instance method)">- (Object) <strong>extension</strong> </a>
210
+
211
+
212
+
213
+ (also: #ext)
214
+
215
+ </span>
216
+
217
+
218
+
219
+
220
+
221
+
222
+
223
+
224
+ <span class="summary_desc"><div class='inline'><p>Returns the matched extension.</p>
225
+ </div></span>
226
+
227
+ </li>
228
+
229
+
230
+ <li class="public ">
231
+ <span class="summary_signature">
232
+
233
+ <a href="#get-instance_method" title="#get (instance method)">- (Object) <strong>get</strong>(path = nil, &amp;blk) </a>
234
+
235
+
236
+
237
+ </span>
238
+
239
+
240
+
241
+
242
+
243
+
244
+
245
+
246
+ <span class="summary_desc"><div class='inline'><p>Respond to a GET request and yield the block.</p>
247
+ </div></span>
248
+
249
+ </li>
250
+
251
+
252
+ <li class="public ">
253
+ <span class="summary_signature">
254
+
255
+ <a href="#multi_variable-instance_method" title="#multi_variable (instance method)">- (Object) <strong>multi_variable</strong>(count, type = nil, &amp;blk) </a>
256
+
257
+
258
+
259
+ (also: #multi_var, #mvar)
260
+
261
+ </span>
262
+
263
+
264
+
265
+
266
+
267
+
268
+
269
+
270
+ <span class="summary_desc"><div class='inline'><p>Same as variable except you can match multiple variables with the same type.</p>
271
+ </div></span>
272
+
273
+ </li>
274
+
275
+
276
+ <li class="public ">
277
+ <span class="summary_signature">
278
+
279
+ <a href="#no_extension-instance_method" title="#no_extension (instance method)">- (Object) <strong>no_extension</strong>(&amp;blk) </a>
280
+
281
+
282
+
283
+ </span>
284
+
285
+
286
+
287
+
288
+
289
+
290
+
291
+
292
+ <span class="summary_desc"><div class='inline'><p>Match no extension.</p>
293
+ </div></span>
294
+
295
+ </li>
296
+
297
+
298
+ <li class="public ">
299
+ <span class="summary_signature">
300
+
301
+ <a href="#part-instance_method" title="#part (instance method)">- (Object) <strong>part</strong>(p, &amp;blk) </a>
302
+
303
+
304
+
305
+ </span>
306
+
307
+
308
+
309
+
310
+
311
+
312
+
313
+
314
+ <span class="summary_desc"><div class='inline'><p>Like #path, but doesn't look for leading slashes.</p>
315
+ </div></span>
316
+
317
+ </li>
318
+
319
+
320
+ <li class="public ">
321
+ <span class="summary_signature">
322
+
323
+ <a href="#partial_variable-instance_method" title="#partial_variable (instance method)">- (Object) <strong>partial_variable</strong>(type = nil, &amp;blk) </a>
324
+
325
+
326
+
327
+ (also: #part_var)
328
+
329
+ </span>
330
+
331
+
332
+
333
+
334
+
335
+
336
+
337
+
338
+ <span class="summary_desc"><div class='inline'><p>Match parts off the path as variables without a leading slash.</p>
339
+ </div></span>
340
+
341
+ </li>
342
+
343
+
344
+ <li class="public ">
345
+ <span class="summary_signature">
346
+
347
+ <a href="#path-instance_method" title="#path (instance method)">- (Object) <strong>path</strong>(p, &amp;blk) </a>
348
+
349
+
350
+
351
+ </span>
352
+
353
+
354
+
355
+
356
+
357
+
358
+
359
+
360
+ <span class="summary_desc"><div class='inline'><p>Match a path to respond to.</p>
361
+ </div></span>
362
+
363
+ </li>
364
+
365
+
366
+ <li class="public ">
367
+ <span class="summary_signature">
368
+
369
+ <a href="#post-instance_method" title="#post (instance method)">- (Object) <strong>post</strong>(path = nil, &amp;blk) </a>
370
+
371
+
372
+
373
+ </span>
374
+
375
+
376
+
377
+
378
+
379
+
380
+
381
+
382
+ <span class="summary_desc"><div class='inline'><p>Respond to a POST request and yield the block.</p>
383
+ </div></span>
384
+
385
+ </li>
386
+
387
+
388
+ <li class="public ">
389
+ <span class="summary_signature">
390
+
391
+ <a href="#put-instance_method" title="#put (instance method)">- (Object) <strong>put</strong>(path = nil, &amp;blk) </a>
392
+
393
+
394
+
395
+ </span>
396
+
397
+
398
+
399
+
400
+
401
+
402
+
403
+
404
+ <span class="summary_desc"><div class='inline'><p>Respond to a PUT request and yield the block.</p>
405
+ </div></span>
406
+
407
+ </li>
408
+
409
+
410
+ <li class="public ">
411
+ <span class="summary_signature">
412
+
413
+ <a href="#query-instance_method" title="#query (instance method)">- (Object) <strong>query</strong>(q, &amp;blk) </a>
414
+
415
+
416
+
417
+ </span>
418
+
419
+
420
+
421
+
422
+
423
+
424
+
425
+
426
+ <span class="summary_desc"><div class='inline'><p>Match variables within the query string.</p>
427
+ </div></span>
428
+
429
+ </li>
430
+
431
+
432
+ <li class="public ">
433
+ <span class="summary_signature">
434
+
435
+ <a href="#query_string-instance_method" title="#query_string (instance method)">- (Object) <strong>query_string</strong>(qs, &amp;blk) </a>
436
+
437
+
438
+
439
+ </span>
440
+
441
+
442
+
443
+
444
+
445
+
446
+
447
+
448
+ <span class="summary_desc"><div class='inline'><p>Yield block if the query string matches.</p>
449
+ </div></span>
450
+
451
+ </li>
452
+
453
+
454
+ <li class="public ">
455
+ <span class="summary_signature">
456
+
457
+ <a href="#remainder-instance_method" title="#remainder (instance method)">- (Object) <strong>remainder</strong>(&amp;blk) </a>
458
+
459
+
460
+
461
+ (also: #catchall)
462
+
463
+ </span>
464
+
465
+
466
+
467
+
468
+
469
+
470
+
471
+
472
+ <span class="summary_desc"><div class='inline'><p>Match any remaining path.</p>
473
+ </div></span>
474
+
475
+ </li>
476
+
477
+
478
+ <li class="public ">
479
+ <span class="summary_signature">
480
+
481
+ <a href="#repeating_variable-instance_method" title="#repeating_variable (instance method)">- (Object) <strong>repeating_variable</strong>(type = nil, &amp;blk) </a>
482
+
483
+
484
+
485
+ (also: #glob)
486
+
487
+ </span>
488
+
489
+
490
+
491
+
492
+
493
+
494
+
495
+
496
+ <span class="summary_desc"><div class='inline'><p>Same as variable except it matches indefinitely.</p>
497
+ </div></span>
498
+
499
+ </li>
500
+
501
+
502
+ <li class="public ">
503
+ <span class="summary_signature">
504
+
505
+ <a href="#variable-instance_method" title="#variable (instance method)">- (Object) <strong>variable</strong>(type = nil, &amp;blk) </a>
506
+
507
+
508
+
509
+ (also: #var)
510
+
511
+ </span>
512
+
513
+
514
+
515
+
516
+
517
+
518
+
519
+
520
+ <span class="summary_desc"><div class='inline'><p>Match parts off the path as variables.</p>
521
+ </div></span>
522
+
523
+ </li>
524
+
525
+
526
+ <li class="public ">
527
+ <span class="summary_signature">
528
+
529
+ <a href="#whole_path-instance_method" title="#whole_path (instance method)">- (Object) <strong>whole_path</strong>(p, &amp;blk) </a>
530
+
531
+
532
+
533
+ </span>
534
+
535
+
536
+
537
+
538
+
539
+
540
+
541
+
542
+ <span class="summary_desc"><div class='inline'><p>Like #path, but requires the entire path to be consumed.</p>
543
+ </div></span>
544
+
545
+ </li>
546
+
547
+
548
+ </ul>
549
+
550
+
551
+
552
+
553
+
554
+
555
+
556
+
557
+
558
+ <div id="instance_method_details" class="method_details_list">
559
+ <h2>Instance Method Details</h2>
560
+
561
+
562
+ <div class="method_details first">
563
+ <p class="signature first" id="allow_continued_routing-instance_method">
564
+
565
+ - (<tt>Object</tt>) <strong>allow_continued_routing</strong>(val = true)
566
+
567
+
568
+
569
+ </p><div class="docstring">
570
+ <div class="discussion">
571
+ <p>Allow continued routing if a routing block fails to match</p>
572
+
573
+
574
+ </div>
575
+ </div>
576
+ <div class="tags">
577
+ <h3>Parameters:</h3>
578
+ <ul class="param">
579
+
580
+ <li>
581
+
582
+ <span class='name'>val</span>
583
+
584
+
585
+ <span class='type'>(<tt>Boolean</tt>)</span>
586
+
587
+
588
+ <em class="default">(defaults to: <tt>true</tt>)</em>
589
+
590
+
591
+ &mdash;
592
+ <div class='inline'><p>indicate if continued routing should be allowed.</p>
593
+ </div>
594
+
595
+ </li>
596
+
597
+ </ul>
598
+
599
+
600
+ </div><table class="source_code">
601
+ <tr>
602
+ <td>
603
+ <pre class="lines">
604
+
605
+
606
+ 13
607
+ 14
608
+ 15
609
+ 16
610
+ 17
611
+ 18
612
+ 19
613
+ 20
614
+ 21</pre>
615
+ </td>
616
+ <td>
617
+ <pre class="code"><span class="info file"># File 'lib/renee/core/routing.rb', line 13</span>
618
+
619
+ <span class='kw'>def</span> <span class='id allow_continued_routing'>allow_continued_routing</span><span class='lparen'>(</span><span class='id val'>val</span> <span class='op'>=</span> <span class='kw'>true</span><span class='rparen'>)</span>
620
+ <span class='id old_allow_continued_routing'>old_allow_continued_routing</span> <span class='op'>=</span> <span class='ivar'>@allow_continued_routing</span>
621
+ <span class='kw'>begin</span>
622
+ <span class='ivar'>@allow_continued_routing</span> <span class='op'>=</span> <span class='id val'>val</span>
623
+ <span class='kw'>yield</span>
624
+ <span class='kw'>ensure</span>
625
+ <span class='ivar'>@allow_continued_routing</span> <span class='op'>=</span> <span class='id old_allow_continued_routing'>old_allow_continued_routing</span>
626
+ <span class='kw'>end</span>
627
+ <span class='kw'>end</span></pre>
628
+ </td>
629
+ </tr>
630
+ </table>
631
+ </div>
632
+
633
+ <div class="method_details ">
634
+ <p class="signature " id="complete-instance_method">
635
+
636
+ - (<tt>Object</tt>) <strong>complete</strong>(&amp;blk)
637
+
638
+
639
+
640
+ </p><div class="docstring">
641
+ <div class="discussion">
642
+ <p>Match only when the path is either '' or '/'.</p>
643
+
644
+
645
+ </div>
646
+ </div>
647
+ <div class="tags">
648
+
649
+ <div class="examples">
650
+ <h3>Examples:</h3>
651
+
652
+ <h4><div class='inline'>
653
+ </div></h4>
654
+ <pre class="example code"><span class='id complete'>complete</span> <span class='lbrace'>{</span> <span class='id halt'>halt</span> <span class='lbracket'>[</span><span class='int'>200</span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>hello world</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='rbrace'>}</span></pre>
655
+
656
+ </div>
657
+
658
+
659
+ </div><table class="source_code">
660
+ <tr>
661
+ <td>
662
+ <pre class="lines">
663
+
664
+
665
+ 206
666
+ 207
667
+ 208
668
+ 209
669
+ 210
670
+ 211
671
+ 212</pre>
672
+ </td>
673
+ <td>
674
+ <pre class="code"><span class="info file"># File 'lib/renee/core/routing.rb', line 206</span>
675
+
676
+ <span class='kw'>def</span> <span class='id complete'>complete</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id blk'>blk</span><span class='rparen'>)</span>
677
+ <span class='kw'>if</span> <span class='id detected_extension'>detected_extension</span> <span class='kw'>and</span> <span class='id env'>env</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>PATH_INFO</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^\/?(\.</span><span class='embexpr_beg'>#{</span><span class='const'>Regexp</span><span class='period'>.</span><span class='id quote'>quote</span><span class='lparen'>(</span><span class='id detected_extension'>detected_extension</span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='tstring_content'>\/?)?$</span><span class='regexp_end'>/</span></span>
678
+ <span class='id with_path_part'>with_path_part</span><span class='lparen'>(</span><span class='id env'>env</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>PATH_INFO</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id blk'>blk</span><span class='period'>.</span><span class='id call'>call</span> <span class='rbrace'>}</span>
679
+ <span class='kw'>elsif</span> <span class='id detected_extension'>detected_extension</span><span class='period'>.</span><span class='id nil?'>nil?</span> <span class='kw'>and</span> <span class='id env'>env</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>PATH_INFO</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^\/?$</span><span class='regexp_end'>/</span></span>
680
+ <span class='id with_path_part'>with_path_part</span><span class='lparen'>(</span><span class='id env'>env</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>PATH_INFO</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id blk'>blk</span><span class='period'>.</span><span class='id call'>call</span> <span class='rbrace'>}</span>
681
+ <span class='kw'>end</span>
682
+ <span class='kw'>end</span></pre>
683
+ </td>
684
+ </tr>
685
+ </table>
686
+ </div>
687
+
688
+ <div class="method_details ">
689
+ <p class="signature " id="delete-instance_method">
690
+
691
+ - (<tt>Object</tt>) <strong>delete</strong>(path = nil, &amp;blk)
692
+
693
+
694
+
695
+ </p><div class="docstring">
696
+ <div class="discussion">
697
+ <p>Respond to a DELETE request and yield the block.</p>
698
+
699
+
700
+ </div>
701
+ </div>
702
+ <div class="tags">
703
+
704
+ <div class="examples">
705
+ <h3>Examples:</h3>
706
+
707
+ <h4><div class='inline'>
708
+ </div></h4>
709
+ <pre class="example code"><span class='id delete'>delete</span> <span class='lbrace'>{</span> <span class='id halt'>halt</span> <span class='lbracket'>[</span><span class='int'>200</span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>hello world</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='rbrace'>}</span></pre>
710
+
711
+ </div>
712
+
713
+
714
+ </div><table class="source_code">
715
+ <tr>
716
+ <td>
717
+ <pre class="lines">
718
+
719
+
720
+ 195
721
+ 196
722
+ 197</pre>
723
+ </td>
724
+ <td>
725
+ <pre class="code"><span class="info file"># File 'lib/renee/core/routing.rb', line 195</span>
726
+
727
+ <span class='kw'>def</span> <span class='id delete'>delete</span><span class='lparen'>(</span><span class='id path'>path</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id blk'>blk</span><span class='rparen'>)</span>
728
+ <span class='id request_method'>request_method</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>DELETE</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id path'>path</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id blk'>blk</span><span class='rparen'>)</span>
729
+ <span class='kw'>end</span></pre>
730
+ </td>
731
+ </tr>
732
+ </table>
733
+ </div>
734
+
735
+ <div class="method_details ">
736
+ <p class="signature " id="empty-instance_method">
737
+
738
+ - (<tt>Object</tt>) <strong>empty</strong>(&amp;blk)
739
+
740
+
741
+
742
+ </p><div class="docstring">
743
+ <div class="discussion">
744
+ <p>Match only when the path is ''.</p>
745
+
746
+
747
+ </div>
748
+ </div>
749
+ <div class="tags">
750
+
751
+ <div class="examples">
752
+ <h3>Examples:</h3>
753
+
754
+ <h4><div class='inline'>
755
+ </div></h4>
756
+ <pre class="example code"><span class='id empty'>empty</span> <span class='lbrace'>{</span> <span class='id halt'>halt</span> <span class='lbracket'>[</span><span class='int'>200</span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>hello world</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='rbrace'>}</span></pre>
757
+
758
+ </div>
759
+
760
+
761
+ </div><table class="source_code">
762
+ <tr>
763
+ <td>
764
+ <pre class="lines">
765
+
766
+
767
+ 221
768
+ 222
769
+ 223
770
+ 224
771
+ 225</pre>
772
+ </td>
773
+ <td>
774
+ <pre class="code"><span class="info file"># File 'lib/renee/core/routing.rb', line 221</span>
775
+
776
+ <span class='kw'>def</span> <span class='id empty'>empty</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id blk'>blk</span><span class='rparen'>)</span>
777
+ <span class='kw'>if</span> <span class='id env'>env</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>PATH_INFO</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span>
778
+ <span class='id with_path_part'>with_path_part</span><span class='lparen'>(</span><span class='id env'>env</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>PATH_INFO</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id blk'>blk</span><span class='period'>.</span><span class='id call'>call</span> <span class='rbrace'>}</span>
779
+ <span class='kw'>end</span>
780
+ <span class='kw'>end</span></pre>
781
+ </td>
782
+ </tr>
783
+ </table>
784
+ </div>
785
+
786
+ <div class="method_details ">
787
+ <p class="signature " id="extension-instance_method">
788
+
789
+ - (<tt>Object</tt>) <strong>extension</strong>
790
+
791
+
792
+
793
+ <span class="aliases">Also known as:
794
+ <span class="names"><span id='ext-instance_method'>ext</span></span>
795
+ </span>
796
+
797
+ </p><div class="docstring">
798
+ <div class="discussion">
799
+ <p>Returns the matched extension. If no extension is present, returns <code>nil</code>.</p>
800
+
801
+
802
+ </div>
803
+ </div>
804
+ <div class="tags">
805
+
806
+ <div class="examples">
807
+ <h3>Examples:</h3>
808
+
809
+ <h4><div class='inline'>
810
+ </div></h4>
811
+ <pre class="example code"><span class='id extension'>extension</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>html</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id path'>path</span><span class='op'>|</span> <span class='id halt'>halt</span> <span class='lbracket'>[</span><span class='int'>200</span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='id path'>path</span><span class='rbracket'>]</span> <span class='rbrace'>}</span></pre>
812
+
813
+ </div>
814
+
815
+
816
+ </div><table class="source_code">
817
+ <tr>
818
+ <td>
819
+ <pre class="lines">
820
+
821
+
822
+ 126
823
+ 127
824
+ 128</pre>
825
+ </td>
826
+ <td>
827
+ <pre class="code"><span class="info file"># File 'lib/renee/core/routing.rb', line 126</span>
828
+
829
+ <span class='kw'>def</span> <span class='id extension'>extension</span>
830
+ <span class='id detected_extension'>detected_extension</span>
831
+ <span class='kw'>end</span></pre>
832
+ </td>
833
+ </tr>
834
+ </table>
835
+ </div>
836
+
837
+ <div class="method_details ">
838
+ <p class="signature " id="get-instance_method">
839
+
840
+ - (<tt>Object</tt>) <strong>get</strong>(path = nil, &amp;blk)
841
+
842
+
843
+
844
+ </p><div class="docstring">
845
+ <div class="discussion">
846
+ <p>Respond to a GET request and yield the block.</p>
847
+
848
+
849
+ </div>
850
+ </div>
851
+ <div class="tags">
852
+
853
+ <div class="examples">
854
+ <h3>Examples:</h3>
855
+
856
+ <h4><div class='inline'>
857
+ </div></h4>
858
+ <pre class="example code"><span class='id get'>get</span> <span class='lbrace'>{</span> <span class='id halt'>halt</span> <span class='lbracket'>[</span><span class='int'>200</span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>hello world</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='rbrace'>}</span></pre>
859
+
860
+ </div>
861
+
862
+
863
+ </div><table class="source_code">
864
+ <tr>
865
+ <td>
866
+ <pre class="lines">
867
+
868
+
869
+ 162
870
+ 163
871
+ 164</pre>
872
+ </td>
873
+ <td>
874
+ <pre class="code"><span class="info file"># File 'lib/renee/core/routing.rb', line 162</span>
875
+
876
+ <span class='kw'>def</span> <span class='id get'>get</span><span class='lparen'>(</span><span class='id path'>path</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id blk'>blk</span><span class='rparen'>)</span>
877
+ <span class='id request_method'>request_method</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>GET</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id path'>path</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id blk'>blk</span><span class='rparen'>)</span>
878
+ <span class='kw'>end</span></pre>
879
+ </td>
880
+ </tr>
881
+ </table>
882
+ </div>
883
+
884
+ <div class="method_details ">
885
+ <p class="signature " id="multi_variable-instance_method">
886
+
887
+ - (<tt>Object</tt>) <strong>multi_variable</strong>(count, type = nil, &amp;blk)
888
+
889
+
890
+
891
+ <span class="aliases">Also known as:
892
+ <span class="names"><span id='multi_var-instance_method'>multi_var</span>, <span id='mvar-instance_method'>mvar</span></span>
893
+ </span>
894
+
895
+ </p><div class="docstring">
896
+ <div class="discussion">
897
+ <p>Same as variable except you can match multiple variables with the same type.</p>
898
+
899
+
900
+ </div>
901
+ </div>
902
+ <div class="tags">
903
+ <h3>Parameters:</h3>
904
+ <ul class="param">
905
+
906
+ <li>
907
+
908
+ <span class='name'>count</span>
909
+
910
+
911
+ <span class='type'>(<tt>Range</tt>, <tt>Integer</tt>)</span>
912
+
913
+
914
+
915
+ &mdash;
916
+ <div class='inline'><p>The number of parameters to capture.</p>
917
+ </div>
918
+
919
+ </li>
920
+
921
+ <li>
922
+
923
+ <span class='name'>type</span>
924
+
925
+
926
+ <span class='type'>(<tt>Symbol</tt>)</span>
927
+
928
+
929
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
930
+
931
+
932
+ &mdash;
933
+ <div class='inline'><p>The type to use for match.</p>
934
+ </div>
935
+
936
+ </li>
937
+
938
+ </ul>
939
+
940
+
941
+ </div><table class="source_code">
942
+ <tr>
943
+ <td>
944
+ <pre class="lines">
945
+
946
+
947
+ 96
948
+ 97
949
+ 98</pre>
950
+ </td>
951
+ <td>
952
+ <pre class="code"><span class="info file"># File 'lib/renee/core/routing.rb', line 96</span>
953
+
954
+ <span class='kw'>def</span> <span class='id multi_variable'>multi_variable</span><span class='lparen'>(</span><span class='id count'>count</span><span class='comma'>,</span> <span class='id type'>type</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id blk'>blk</span><span class='rparen'>)</span>
955
+ <span class='id complex_variable'>complex_variable</span><span class='lparen'>(</span><span class='id type'>type</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>/</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id count'>count</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id blk'>blk</span><span class='rparen'>)</span>
956
+ <span class='kw'>end</span></pre>
957
+ </td>
958
+ </tr>
959
+ </table>
960
+ </div>
961
+
962
+ <div class="method_details ">
963
+ <p class="signature " id="no_extension-instance_method">
964
+
965
+ - (<tt>Object</tt>) <strong>no_extension</strong>(&amp;blk)
966
+
967
+
968
+
969
+ </p><div class="docstring">
970
+ <div class="discussion">
971
+ <p>Match no extension.</p>
972
+
973
+
974
+ </div>
975
+ </div>
976
+ <div class="tags">
977
+
978
+ <div class="examples">
979
+ <h3>Examples:</h3>
980
+
981
+ <h4><div class='inline'>
982
+ </div></h4>
983
+ <pre class="example code"><span class='id no_extension'>no_extension</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id path'>path</span><span class='op'>|</span> <span class='id halt'>halt</span> <span class='lbracket'>[</span><span class='int'>200</span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='id path'>path</span><span class='rbracket'>]</span> <span class='rbrace'>}</span></pre>
984
+
985
+ </div>
986
+
987
+
988
+ </div><table class="source_code">
989
+ <tr>
990
+ <td>
991
+ <pre class="lines">
992
+
993
+
994
+ 137
995
+ 138
996
+ 139
997
+ 140
998
+ 141</pre>
999
+ </td>
1000
+ <td>
1001
+ <pre class="code"><span class="info file"># File 'lib/renee/core/routing.rb', line 137</span>
1002
+
1003
+ <span class='kw'>def</span> <span class='id no_extension'>no_extension</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id blk'>blk</span><span class='rparen'>)</span>
1004
+ <span class='id allow_continued_routing'>allow_continued_routing</span> <span class='kw'>do</span>
1005
+ <span class='id blk'>blk</span><span class='period'>.</span><span class='id call'>call</span> <span class='kw'>if</span> <span class='id detected_extension'>detected_extension</span><span class='period'>.</span><span class='id nil?'>nil?</span>
1006
+ <span class='kw'>end</span>
1007
+ <span class='kw'>end</span></pre>
1008
+ </td>
1009
+ </tr>
1010
+ </table>
1011
+ </div>
1012
+
1013
+ <div class="method_details ">
1014
+ <p class="signature " id="part-instance_method">
1015
+
1016
+ - (<tt>Object</tt>) <strong>part</strong>(p, &amp;blk)
1017
+
1018
+
1019
+
1020
+ </p><div class="docstring">
1021
+ <div class="discussion">
1022
+ <p>Like #path, but doesn't look for leading slashes.</p>
1023
+
1024
+
1025
+ </div>
1026
+ </div>
1027
+ <div class="tags">
1028
+
1029
+
1030
+ </div><table class="source_code">
1031
+ <tr>
1032
+ <td>
1033
+ <pre class="lines">
1034
+
1035
+
1036
+ 55
1037
+ 56
1038
+ 57
1039
+ 58
1040
+ 59
1041
+ 60</pre>
1042
+ </td>
1043
+ <td>
1044
+ <pre class="code"><span class="info file"># File 'lib/renee/core/routing.rb', line 55</span>
1045
+
1046
+ <span class='kw'>def</span> <span class='id part'>part</span><span class='lparen'>(</span><span class='id p'>p</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id blk'>blk</span><span class='rparen'>)</span>
1047
+ <span class='id p'>p</span> <span class='op'>=</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^\/?</span><span class='embexpr_beg'>#{</span><span class='const'>Regexp</span><span class='period'>.</span><span class='id quote'>quote</span><span class='lparen'>(</span><span class='id p'>p</span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='regexp_end'>/</span></span> <span class='kw'>if</span> <span class='id p'>p</span><span class='period'>.</span><span class='id is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>String</span><span class='rparen'>)</span>
1048
+ <span class='kw'>if</span> <span class='id match'>match</span> <span class='op'>=</span> <span class='id env'>env</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>PATH_INFO</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id p'>p</span><span class='rbracket'>]</span>
1049
+ <span class='id with_path_part'>with_path_part</span><span class='lparen'>(</span><span class='id match'>match</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id blk'>blk</span><span class='period'>.</span><span class='id call'>call</span> <span class='rbrace'>}</span>
1050
+ <span class='kw'>end</span>
1051
+ <span class='kw'>end</span></pre>
1052
+ </td>
1053
+ </tr>
1054
+ </table>
1055
+ </div>
1056
+
1057
+ <div class="method_details ">
1058
+ <p class="signature " id="partial_variable-instance_method">
1059
+
1060
+ - (<tt>Object</tt>) <strong>partial_variable</strong>(type = nil, &amp;blk)
1061
+
1062
+
1063
+
1064
+ <span class="aliases">Also known as:
1065
+ <span class="names"><span id='part_var-instance_method'>part_var</span></span>
1066
+ </span>
1067
+
1068
+ </p><div class="docstring">
1069
+ <div class="discussion">
1070
+ <p>Match parts off the path as variables without a leading slash.</p>
1071
+
1072
+
1073
+ </div>
1074
+ </div>
1075
+ <div class="tags">
1076
+
1077
+
1078
+ <h3>See Also:</h3>
1079
+ <ul class="see">
1080
+
1081
+ <li><span class='object_link'><a href="#variable-instance_method" title="Renee::Core::Routing#variable (method)">#variable</a></span></li>
1082
+
1083
+ </ul>
1084
+
1085
+ </div><table class="source_code">
1086
+ <tr>
1087
+ <td>
1088
+ <pre class="lines">
1089
+
1090
+
1091
+ 114
1092
+ 115
1093
+ 116</pre>
1094
+ </td>
1095
+ <td>
1096
+ <pre class="code"><span class="info file"># File 'lib/renee/core/routing.rb', line 114</span>
1097
+
1098
+ <span class='kw'>def</span> <span class='id partial_variable'>partial_variable</span><span class='lparen'>(</span><span class='id type'>type</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id blk'>blk</span><span class='rparen'>)</span>
1099
+ <span class='id complex_variable'>complex_variable</span><span class='lparen'>(</span><span class='id type'>type</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='int'>1</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id blk'>blk</span><span class='rparen'>)</span>
1100
+ <span class='kw'>end</span></pre>
1101
+ </td>
1102
+ </tr>
1103
+ </table>
1104
+ </div>
1105
+
1106
+ <div class="method_details ">
1107
+ <p class="signature " id="path-instance_method">
1108
+
1109
+ - (<tt>Object</tt>) <strong>path</strong>(p, &amp;blk)
1110
+
1111
+
1112
+
1113
+ </p><div class="docstring">
1114
+ <div class="discussion">
1115
+ <p>Match a path to respond to.</p>
1116
+
1117
+
1118
+ </div>
1119
+ </div>
1120
+ <div class="tags">
1121
+
1122
+ <div class="examples">
1123
+ <h3>Examples:</h3>
1124
+
1125
+ <h4><div class='inline'>
1126
+ </div></h4>
1127
+ <pre class="example code">path('/') { ... } #=&gt; '/'
1128
+ path('test') { ... } #=&gt; '/test'
1129
+
1130
+ path 'foo' do
1131
+ path('bar') { ... } #=&gt; '/foo/bar'
1132
+ end</pre>
1133
+
1134
+ </div>
1135
+ <h3>Parameters:</h3>
1136
+ <ul class="param">
1137
+
1138
+ <li>
1139
+
1140
+ <span class='name'>p</span>
1141
+
1142
+
1143
+ <span class='type'>(<tt>String</tt>)</span>
1144
+
1145
+
1146
+
1147
+ &mdash;
1148
+ <div class='inline'><p>path to match.</p>
1149
+ </div>
1150
+
1151
+ </li>
1152
+
1153
+ <li>
1154
+
1155
+ <span class='name'>blk</span>
1156
+
1157
+
1158
+ <span class='type'>(<tt>Proc</tt>)</span>
1159
+
1160
+
1161
+
1162
+ &mdash;
1163
+ <div class='inline'><p>block to yield</p>
1164
+ </div>
1165
+
1166
+ </li>
1167
+
1168
+ </ul>
1169
+
1170
+
1171
+ </div><table class="source_code">
1172
+ <tr>
1173
+ <td>
1174
+ <pre class="lines">
1175
+
1176
+
1177
+ 40
1178
+ 41
1179
+ 42
1180
+ 43
1181
+ 44</pre>
1182
+ </td>
1183
+ <td>
1184
+ <pre class="code"><span class="info file"># File 'lib/renee/core/routing.rb', line 40</span>
1185
+
1186
+ <span class='kw'>def</span> <span class='id path'>path</span><span class='lparen'>(</span><span class='id p'>p</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id blk'>blk</span><span class='rparen'>)</span>
1187
+ <span class='id p'>p</span> <span class='op'>=</span> <span class='id p'>p</span><span class='lbracket'>[</span><span class='int'>1</span><span class='comma'>,</span> <span class='id p'>p</span><span class='period'>.</span><span class='id size'>size</span><span class='rbracket'>]</span> <span class='kw'>if</span> <span class='id p'>p</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='CHAR'>?/</span>
1188
+ <span class='id extension_part'>extension_part</span> <span class='op'>=</span> <span class='id detected_extension'>detected_extension</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>|\\.</span><span class='embexpr_beg'>#{</span><span class='const'>Regexp</span><span class='period'>.</span><span class='id quote'>quote</span><span class='lparen'>(</span><span class='id detected_extension'>detected_extension</span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_end'>&quot;</span></span>
1189
+ <span class='id part'>part</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^\/</span><span class='embexpr_beg'>#{</span><span class='const'>Regexp</span><span class='period'>.</span><span class='id quote'>quote</span><span class='lparen'>(</span><span class='id p'>p</span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='tstring_content'>(?=\/|$</span><span class='embexpr_beg'>#{</span><span class='id extension_part'>extension_part</span><span class='rbrace'>}</span><span class='tstring_content'>)</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id blk'>blk</span><span class='rparen'>)</span>
1190
+ <span class='kw'>end</span></pre>
1191
+ </td>
1192
+ </tr>
1193
+ </table>
1194
+ </div>
1195
+
1196
+ <div class="method_details ">
1197
+ <p class="signature " id="post-instance_method">
1198
+
1199
+ - (<tt>Object</tt>) <strong>post</strong>(path = nil, &amp;blk)
1200
+
1201
+
1202
+
1203
+ </p><div class="docstring">
1204
+ <div class="discussion">
1205
+ <p>Respond to a POST request and yield the block.</p>
1206
+
1207
+
1208
+ </div>
1209
+ </div>
1210
+ <div class="tags">
1211
+
1212
+ <div class="examples">
1213
+ <h3>Examples:</h3>
1214
+
1215
+ <h4><div class='inline'>
1216
+ </div></h4>
1217
+ <pre class="example code"><span class='id post'>post</span> <span class='lbrace'>{</span> <span class='id halt'>halt</span> <span class='lbracket'>[</span><span class='int'>200</span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>hello world</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='rbrace'>}</span></pre>
1218
+
1219
+ </div>
1220
+
1221
+
1222
+ </div><table class="source_code">
1223
+ <tr>
1224
+ <td>
1225
+ <pre class="lines">
1226
+
1227
+
1228
+ 173
1229
+ 174
1230
+ 175</pre>
1231
+ </td>
1232
+ <td>
1233
+ <pre class="code"><span class="info file"># File 'lib/renee/core/routing.rb', line 173</span>
1234
+
1235
+ <span class='kw'>def</span> <span class='id post'>post</span><span class='lparen'>(</span><span class='id path'>path</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id blk'>blk</span><span class='rparen'>)</span>
1236
+ <span class='id request_method'>request_method</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>POST</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id path'>path</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id blk'>blk</span><span class='rparen'>)</span>
1237
+ <span class='kw'>end</span></pre>
1238
+ </td>
1239
+ </tr>
1240
+ </table>
1241
+ </div>
1242
+
1243
+ <div class="method_details ">
1244
+ <p class="signature " id="put-instance_method">
1245
+
1246
+ - (<tt>Object</tt>) <strong>put</strong>(path = nil, &amp;blk)
1247
+
1248
+
1249
+
1250
+ </p><div class="docstring">
1251
+ <div class="discussion">
1252
+ <p>Respond to a PUT request and yield the block.</p>
1253
+
1254
+
1255
+ </div>
1256
+ </div>
1257
+ <div class="tags">
1258
+
1259
+ <div class="examples">
1260
+ <h3>Examples:</h3>
1261
+
1262
+ <h4><div class='inline'>
1263
+ </div></h4>
1264
+ <pre class="example code"><span class='id put'>put</span> <span class='lbrace'>{</span> <span class='id halt'>halt</span> <span class='lbracket'>[</span><span class='int'>200</span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>hello world</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='rbrace'>}</span></pre>
1265
+
1266
+ </div>
1267
+
1268
+
1269
+ </div><table class="source_code">
1270
+ <tr>
1271
+ <td>
1272
+ <pre class="lines">
1273
+
1274
+
1275
+ 184
1276
+ 185
1277
+ 186</pre>
1278
+ </td>
1279
+ <td>
1280
+ <pre class="code"><span class="info file"># File 'lib/renee/core/routing.rb', line 184</span>
1281
+
1282
+ <span class='kw'>def</span> <span class='id put'>put</span><span class='lparen'>(</span><span class='id path'>path</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id blk'>blk</span><span class='rparen'>)</span>
1283
+ <span class='id request_method'>request_method</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>PUT</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id path'>path</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id blk'>blk</span><span class='rparen'>)</span>
1284
+ <span class='kw'>end</span></pre>
1285
+ </td>
1286
+ </tr>
1287
+ </table>
1288
+ </div>
1289
+
1290
+ <div class="method_details ">
1291
+ <p class="signature " id="query-instance_method">
1292
+
1293
+ - (<tt>Object</tt>) <strong>query</strong>(q, &amp;blk)
1294
+
1295
+
1296
+
1297
+ </p><div class="docstring">
1298
+ <div class="discussion">
1299
+ <p>Match variables within the query string.</p>
1300
+
1301
+
1302
+ </div>
1303
+ </div>
1304
+ <div class="tags">
1305
+
1306
+ <div class="examples">
1307
+ <h3>Examples:</h3>
1308
+
1309
+ <h4><div class='inline'>
1310
+ </div></h4>
1311
+ <pre class="example code"><span class='id query'>query</span><span class='lparen'>(</span><span class='symbol'>:key</span> <span class='op'>=&gt;</span> <span class='symbol'>:integer</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id h'>h</span><span class='op'>|</span> <span class='id halt'>halt</span> <span class='lbracket'>[</span><span class='int'>200</span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>hello world </span><span class='embexpr_beg'>#{</span><span class='id h'>h</span><span class='lbracket'>[</span><span class='symbol'>:key</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='rbrace'>}</span></pre>
1312
+
1313
+ <h4><div class='inline'>
1314
+ </div></h4>
1315
+ <pre class="example code"><span class='id query'>query</span><span class='lparen'>(</span><span class='symbol'>:key</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id val'>val</span><span class='op'>|</span> <span class='id halt'>halt</span> <span class='lbracket'>[</span><span class='int'>200</span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>key is </span><span class='embexpr_beg'>#{</span><span class='id val'>val</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='rbrace'>}</span></pre>
1316
+
1317
+ </div>
1318
+ <h3>Parameters:</h3>
1319
+ <ul class="param">
1320
+
1321
+ <li>
1322
+
1323
+ <span class='name'>q</span>
1324
+
1325
+
1326
+ <span class='type'>(<tt>Array</tt>, <tt>Hash</tt>)</span>
1327
+
1328
+
1329
+
1330
+ &mdash;
1331
+ <div class='inline'><p>Either an array or hash of things to match query string variables. If given
1332
+ an array, if you pass the values for each key as parameters to the block given.
1333
+ If given a hash, then every value must be able to be matched by a registered type.</p>
1334
+ </div>
1335
+
1336
+ </li>
1337
+
1338
+ </ul>
1339
+
1340
+
1341
+ </div><table class="source_code">
1342
+ <tr>
1343
+ <td>
1344
+ <pre class="lines">
1345
+
1346
+
1347
+ 242
1348
+ 243
1349
+ 244
1350
+ 245
1351
+ 246
1352
+ 247
1353
+ 248</pre>
1354
+ </td>
1355
+ <td>
1356
+ <pre class="code"><span class="info file"># File 'lib/renee/core/routing.rb', line 242</span>
1357
+
1358
+ <span class='kw'>def</span> <span class='id query'>query</span><span class='lparen'>(</span><span class='id q'>q</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id blk'>blk</span><span class='rparen'>)</span>
1359
+ <span class='kw'>case</span> <span class='id q'>q</span>
1360
+ <span class='kw'>when</span> <span class='const'>Hash</span> <span class='kw'>then</span> <span class='id blk'>blk</span><span class='period'>.</span><span class='id call'>call</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='lbracket'>[</span><span class='id q'>q</span><span class='period'>.</span><span class='id map'>map</span><span class='lbrace'>{</span><span class='op'>|</span><span class='lparen'>(</span><span class='id k'>k</span><span class='comma'>,</span> <span class='id v'>v</span><span class='rparen'>)</span><span class='op'>|</span> <span class='lbracket'>[</span><span class='id k'>k</span><span class='comma'>,</span> <span class='id transform'>transform</span><span class='lparen'>(</span><span class='id v'>v</span><span class='comma'>,</span> <span class='id request'>request</span><span class='lbracket'>[</span><span class='id k'>k</span><span class='period'>.</span><span class='id to_s'>to_s</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='kw'>return</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='rbracket'>]</span><span class='rparen'>)</span>
1361
+ <span class='kw'>when</span> <span class='const'>Array</span> <span class='kw'>then</span> <span class='id blk'>blk</span><span class='period'>.</span><span class='id call'>call</span><span class='lparen'>(</span><span class='op'>*</span><span class='id q'>q</span><span class='period'>.</span><span class='id map'>map</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id qk'>qk</span><span class='op'>|</span> <span class='id request'>request</span><span class='lbracket'>[</span><span class='id qk'>qk</span><span class='period'>.</span><span class='id to_s'>to_s</span><span class='rbracket'>]</span> <span class='kw'>or</span> <span class='kw'>return</span> <span class='rbrace'>}</span><span class='rparen'>)</span>
1362
+ <span class='kw'>else</span> <span class='id query'>query</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='id q'>q</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id blk'>blk</span><span class='rparen'>)</span>
1363
+ <span class='kw'>end</span>
1364
+ <span class='kw'>end</span></pre>
1365
+ </td>
1366
+ </tr>
1367
+ </table>
1368
+ </div>
1369
+
1370
+ <div class="method_details ">
1371
+ <p class="signature " id="query_string-instance_method">
1372
+
1373
+ - (<tt>Object</tt>) <strong>query_string</strong>(qs, &amp;blk)
1374
+
1375
+
1376
+
1377
+ </p><div class="docstring">
1378
+ <div class="discussion">
1379
+ <p>Yield block if the query string matches.</p>
1380
+
1381
+
1382
+ </div>
1383
+ </div>
1384
+ <div class="tags">
1385
+
1386
+ <div class="examples">
1387
+ <h3>Examples:</h3>
1388
+
1389
+ <h4><div class='inline'>
1390
+ </div></h4>
1391
+ <pre class="example code"><span class='id path'>path</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>test</span><span class='tstring_end'>'</span></span> <span class='kw'>do</span>
1392
+ <span class='id query_string'>query_string</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>foo=bar</span><span class='tstring_end'>'</span></span> <span class='kw'>do</span>
1393
+ <span class='id halt'>halt</span> <span class='lbracket'>[</span><span class='int'>200</span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>matched</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
1394
+ <span class='kw'>end</span>
1395
+ <span class='kw'>end</span>
1396
+ <span class='const'>GET</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='regexp_end'>test?foo=bar #=&gt; 'matched'</span></span></pre>
1397
+
1398
+ </div>
1399
+ <h3>Parameters:</h3>
1400
+ <ul class="param">
1401
+
1402
+ <li>
1403
+
1404
+ <span class='name'>qs</span>
1405
+
1406
+
1407
+ <span class='type'>(<tt>String</tt>)</span>
1408
+
1409
+
1410
+
1411
+ &mdash;
1412
+ <div class='inline'><p>The query string to match.</p>
1413
+ </div>
1414
+
1415
+ </li>
1416
+
1417
+ </ul>
1418
+
1419
+
1420
+ </div><table class="source_code">
1421
+ <tr>
1422
+ <td>
1423
+ <pre class="lines">
1424
+
1425
+
1426
+ 265
1427
+ 266
1428
+ 267</pre>
1429
+ </td>
1430
+ <td>
1431
+ <pre class="code"><span class="info file"># File 'lib/renee/core/routing.rb', line 265</span>
1432
+
1433
+ <span class='kw'>def</span> <span class='id query_string'>query_string</span><span class='lparen'>(</span><span class='id qs'>qs</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id blk'>blk</span><span class='rparen'>)</span>
1434
+ <span class='id blk'>blk</span><span class='period'>.</span><span class='id call'>call</span> <span class='kw'>if</span> <span class='id qs'>qs</span> <span class='op'>===</span> <span class='id env'>env</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>QUERY_STRING</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
1435
+ <span class='kw'>end</span></pre>
1436
+ </td>
1437
+ </tr>
1438
+ </table>
1439
+ </div>
1440
+
1441
+ <div class="method_details ">
1442
+ <p class="signature " id="remainder-instance_method">
1443
+
1444
+ - (<tt>Object</tt>) <strong>remainder</strong>(&amp;blk)
1445
+
1446
+
1447
+
1448
+ <span class="aliases">Also known as:
1449
+ <span class="names"><span id='catchall-instance_method'>catchall</span></span>
1450
+ </span>
1451
+
1452
+ </p><div class="docstring">
1453
+ <div class="discussion">
1454
+ <p>Match any remaining path.</p>
1455
+
1456
+
1457
+ </div>
1458
+ </div>
1459
+ <div class="tags">
1460
+
1461
+ <div class="examples">
1462
+ <h3>Examples:</h3>
1463
+
1464
+ <h4><div class='inline'>
1465
+ </div></h4>
1466
+ <pre class="example code"><span class='id remainder'>remainder</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id path'>path</span><span class='op'>|</span> <span class='id halt'>halt</span> <span class='lbracket'>[</span><span class='int'>200</span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='id path'>path</span><span class='rbracket'>]</span> <span class='rbrace'>}</span></pre>
1467
+
1468
+ </div>
1469
+
1470
+
1471
+ </div><table class="source_code">
1472
+ <tr>
1473
+ <td>
1474
+ <pre class="lines">
1475
+
1476
+
1477
+ 150
1478
+ 151
1479
+ 152</pre>
1480
+ </td>
1481
+ <td>
1482
+ <pre class="code"><span class="info file"># File 'lib/renee/core/routing.rb', line 150</span>
1483
+
1484
+ <span class='kw'>def</span> <span class='id remainder'>remainder</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id blk'>blk</span><span class='rparen'>)</span>
1485
+ <span class='id with_path_part'>with_path_part</span><span class='lparen'>(</span><span class='id env'>env</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>PATH_INFO</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id var'>var</span><span class='op'>|</span> <span class='id blk'>blk</span><span class='period'>.</span><span class='id call'>call</span><span class='lparen'>(</span><span class='id var'>var</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
1486
+ <span class='kw'>end</span></pre>
1487
+ </td>
1488
+ </tr>
1489
+ </table>
1490
+ </div>
1491
+
1492
+ <div class="method_details ">
1493
+ <p class="signature " id="repeating_variable-instance_method">
1494
+
1495
+ - (<tt>Object</tt>) <strong>repeating_variable</strong>(type = nil, &amp;blk)
1496
+
1497
+
1498
+
1499
+ <span class="aliases">Also known as:
1500
+ <span class="names"><span id='glob-instance_method'>glob</span></span>
1501
+ </span>
1502
+
1503
+ </p><div class="docstring">
1504
+ <div class="discussion">
1505
+ <p>Same as variable except it matches indefinitely.</p>
1506
+
1507
+
1508
+ </div>
1509
+ </div>
1510
+ <div class="tags">
1511
+ <h3>Parameters:</h3>
1512
+ <ul class="param">
1513
+
1514
+ <li>
1515
+
1516
+ <span class='name'>type</span>
1517
+
1518
+
1519
+ <span class='type'>(<tt>Symbol</tt>)</span>
1520
+
1521
+
1522
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
1523
+
1524
+
1525
+ &mdash;
1526
+ <div class='inline'><p>The type to use for match.</p>
1527
+ </div>
1528
+
1529
+ </li>
1530
+
1531
+ </ul>
1532
+
1533
+
1534
+ </div><table class="source_code">
1535
+ <tr>
1536
+ <td>
1537
+ <pre class="lines">
1538
+
1539
+
1540
+ 105
1541
+ 106
1542
+ 107</pre>
1543
+ </td>
1544
+ <td>
1545
+ <pre class="code"><span class="info file"># File 'lib/renee/core/routing.rb', line 105</span>
1546
+
1547
+ <span class='kw'>def</span> <span class='id repeating_variable'>repeating_variable</span><span class='lparen'>(</span><span class='id type'>type</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id blk'>blk</span><span class='rparen'>)</span>
1548
+ <span class='id complex_variable'>complex_variable</span><span class='lparen'>(</span><span class='id type'>type</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>/</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id blk'>blk</span><span class='rparen'>)</span>
1549
+ <span class='kw'>end</span></pre>
1550
+ </td>
1551
+ </tr>
1552
+ </table>
1553
+ </div>
1554
+
1555
+ <div class="method_details ">
1556
+ <p class="signature " id="variable-instance_method">
1557
+
1558
+ - (<tt>Object</tt>) <strong>variable</strong>(type = nil, &amp;blk)
1559
+
1560
+
1561
+
1562
+ <span class="aliases">Also known as:
1563
+ <span class="names"><span id='var-instance_method'>var</span></span>
1564
+ </span>
1565
+
1566
+ </p><div class="docstring">
1567
+ <div class="discussion">
1568
+ <p>Match parts off the path as variables. The parts matcher can conform to either a regular expression, or be an Integer, or
1569
+ simply a String.
1570
+ @param[Object] type the type of object to match for. If you supply Integer, this will only match integers in addition to casting your variable for you.
1571
+ @param[Object] default the default value to use if your param cannot be successfully matched.</p>
1572
+
1573
+
1574
+ </div>
1575
+ </div>
1576
+ <div class="tags">
1577
+
1578
+ <div class="examples">
1579
+ <h3>Examples:</h3>
1580
+
1581
+ <h4><div class='inline'>
1582
+ </div></h4>
1583
+ <pre class="example code"><span class='id path'>path</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>/</span><span class='tstring_end'>'</span></span> <span class='kw'>do</span>
1584
+ <span class='id variable'>variable</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id id'>id</span><span class='op'>|</span> <span class='id halt'>halt</span> <span class='lbracket'>[</span><span class='int'>200</span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='id id'>id</span><span class='rbracket'>]</span> <span class='rbrace'>}</span>
1585
+ <span class='kw'>end</span>
1586
+ <span class='const'>GET</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='regexp_end'>hey #=&gt; [200, {}, 'hey']</span></span></pre>
1587
+
1588
+ <h4><div class='inline'>
1589
+ </div></h4>
1590
+ <pre class="example code"><span class='id path'>path</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>/</span><span class='tstring_end'>'</span></span> <span class='kw'>do</span>
1591
+ <span class='id variable'>variable</span><span class='lparen'>(</span><span class='symbol'>:integer</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id id'>id</span><span class='op'>|</span> <span class='id halt'>halt</span> <span class='lbracket'>[</span><span class='int'>200</span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>This is a numeric id: </span><span class='embexpr_beg'>#{</span><span class='id id'>id</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='rbrace'>}</span>
1592
+ <span class='kw'>end</span>
1593
+ <span class='const'>GET</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='regexp_end'>123 #=&gt; [200, {}, 'This is a numeric id: 123']</span></span></pre>
1594
+
1595
+ <h4><div class='inline'>
1596
+ </div></h4>
1597
+ <pre class="example code"><span class='id path'>path</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>/test</span><span class='tstring_end'>'</span></span> <span class='kw'>do</span>
1598
+ <span class='id variable'>variable</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id foo'>foo</span><span class='comma'>,</span> <span class='id bar'>bar</span><span class='op'>|</span> <span class='id halt'>halt</span> <span class='lbracket'>[</span><span class='int'>200</span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id foo'>foo</span><span class='rbrace'>}</span><span class='tstring_content'>-</span><span class='embexpr_beg'>#{</span><span class='id bar'>bar</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='rbrace'>}</span>
1599
+ <span class='kw'>end</span>
1600
+ <span class='const'>GET</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>test</span><span class='regexp_end'>/hey</span></span><span class='op'>/</span><span class='id there'>there</span> <span class='comment'>#=&gt; [200, {}, 'hey-there']</span></pre>
1601
+
1602
+ </div>
1603
+
1604
+
1605
+ </div><table class="source_code">
1606
+ <tr>
1607
+ <td>
1608
+ <pre class="lines">
1609
+
1610
+
1611
+ 87
1612
+ 88
1613
+ 89</pre>
1614
+ </td>
1615
+ <td>
1616
+ <pre class="code"><span class="info file"># File 'lib/renee/core/routing.rb', line 87</span>
1617
+
1618
+ <span class='kw'>def</span> <span class='id variable'>variable</span><span class='lparen'>(</span><span class='id type'>type</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id blk'>blk</span><span class='rparen'>)</span>
1619
+ <span class='id complex_variable'>complex_variable</span><span class='lparen'>(</span><span class='id type'>type</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>/</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='int'>1</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id blk'>blk</span><span class='rparen'>)</span>
1620
+ <span class='kw'>end</span></pre>
1621
+ </td>
1622
+ </tr>
1623
+ </table>
1624
+ </div>
1625
+
1626
+ <div class="method_details ">
1627
+ <p class="signature " id="whole_path-instance_method">
1628
+
1629
+ - (<tt>Object</tt>) <strong>whole_path</strong>(p, &amp;blk)
1630
+
1631
+
1632
+
1633
+ </p><div class="docstring">
1634
+ <div class="discussion">
1635
+ <p>Like #path, but requires the entire path to be consumed.</p>
1636
+
1637
+
1638
+ </div>
1639
+ </div>
1640
+ <div class="tags">
1641
+
1642
+
1643
+ <h3>See Also:</h3>
1644
+ <ul class="see">
1645
+
1646
+ <li><span class='object_link'><a href="#path-instance_method" title="Renee::Core::Routing#path (method)">#path</a></span></li>
1647
+
1648
+ </ul>
1649
+
1650
+ </div><table class="source_code">
1651
+ <tr>
1652
+ <td>
1653
+ <pre class="lines">
1654
+
1655
+
1656
+ 49
1657
+ 50
1658
+ 51</pre>
1659
+ </td>
1660
+ <td>
1661
+ <pre class="code"><span class="info file"># File 'lib/renee/core/routing.rb', line 49</span>
1662
+
1663
+ <span class='kw'>def</span> <span class='id whole_path'>whole_path</span><span class='lparen'>(</span><span class='id p'>p</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id blk'>blk</span><span class='rparen'>)</span>
1664
+ <span class='id path'>path</span><span class='lparen'>(</span><span class='id p'>p</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id complete'>complete</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id blk'>blk</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
1665
+ <span class='kw'>end</span></pre>
1666
+ </td>
1667
+ </tr>
1668
+ </table>
1669
+ </div>
1670
+
1671
+ </div>
1672
+
1673
+ </div>
1674
+
1675
+ <div id="footer">
1676
+ Generated on Thu Dec 22 09:52:35 2011 by
1677
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1678
+ 0.7.3 (ruby-1.9.2).
1679
+ </div>
1680
+
1681
+ </body>
1682
+ </html>