Capcode 0.5.0 → 0.6.0

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.
@@ -105,7 +105,7 @@ application :
105
105
  end
106
106
  </pre>
107
107
  <p>
108
- Do the same (r500 and r501) to customize 500 and 501 errors
108
+ Do the same (r500, r501, r403) to customize 500, 501, 403 errors
109
109
  </p>
110
110
 
111
111
 
@@ -103,11 +103,26 @@ controllers
103
103
  </ul>
104
104
 
105
105
  <h2 class="ruled">Methods</h2>
106
+ <h4 class="ruled">Public Class method:
107
+ <strong><a name="M000009">root=(p)</a></strong> <a href="#M000009"><img src="../../permalink.gif" border="0" title="Permalink to Public Class method: root=" /></a></h4>
108
+
109
+
110
+ <div class="sourcecode">
111
+ <p class="source-link">[ <a href="javascript:toggleSource('M000009_source')" id="l_M000009_source">show source</a> ]</p>
112
+ <div id="M000009_source" class="dyn-source">
113
+ <pre>
114
+ <span class="ruby-comment cmt"># File lib/capcode.rb, line 26</span>
115
+ 26: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">root=</span>(<span class="ruby-identifier">p</span>)
116
+ 27: <span class="ruby-ivar">@@__ROOT_DIRECTORY</span>=<span class="ruby-identifier">p</span>
117
+ 28: <span class="ruby-keyword kw">end</span>
118
+ </pre>
119
+ </div>
120
+ </div>
106
121
  <h4 class="ruled">Public Instance method:
107
- <strong><a name="M000012">URL( klass, *a )</a></strong> <a href="#M000012"><img src="../../permalink.gif" border="0" title="Permalink to Public Instance method: URL" /></a></h4>
122
+ <strong><a name="M000013">URL( klass, *a )</a></strong> <a href="#M000013"><img src="../../permalink.gif" border="0" title="Permalink to Public Instance method: URL" /></a></h4>
108
123
 
109
124
  <p>
110
- Builds an <a href="Helpers.html#M000012">URL</a> route to a controller or a
125
+ Builds an <a href="Helpers.html#M000013">URL</a> route to a controller or a
111
126
  path
112
127
  </p>
113
128
  <p>
@@ -128,29 +143,29 @@ then
128
143
  </pre>
129
144
 
130
145
  <div class="sourcecode">
131
- <p class="source-link">[ <a href="javascript:toggleSource('M000012_source')" id="l_M000012_source">show source</a> ]</p>
132
- <div id="M000012_source" class="dyn-source">
146
+ <p class="source-link">[ <a href="javascript:toggleSource('M000013_source')" id="l_M000013_source">show source</a> ]</p>
147
+ <div id="M000013_source" class="dyn-source">
133
148
  <pre>
134
- <span class="ruby-comment cmt"># File lib/capcode.rb, line 85</span>
135
- 85: <span class="ruby-keyword kw">def</span> <span class="ruby-constant">URL</span>( <span class="ruby-identifier">klass</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">a</span> )
136
- 86: <span class="ruby-identifier">path</span> = <span class="ruby-keyword kw">nil</span>
137
- 87: <span class="ruby-identifier">a</span> = <span class="ruby-identifier">a</span>.<span class="ruby-identifier">delete_if</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-identifier">x</span>.<span class="ruby-identifier">nil?</span> }
138
- 88:
139
- 89: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Class</span>
140
- 90: <span class="ruby-constant">Capcode</span>.<span class="ruby-identifier">routes</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">p</span>, <span class="ruby-identifier">k</span><span class="ruby-operator">|</span>
141
- 91: <span class="ruby-identifier">path</span> = <span class="ruby-identifier">p</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">k</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">klass</span>
142
- 92: <span class="ruby-keyword kw">end</span>
143
- 93: <span class="ruby-keyword kw">else</span>
144
- 94: <span class="ruby-identifier">path</span> = <span class="ruby-identifier">klass</span>
145
- 95: <span class="ruby-keyword kw">end</span>
146
- 96:
147
- 97: <span class="ruby-identifier">path</span><span class="ruby-operator">+</span>((<span class="ruby-identifier">a</span>.<span class="ruby-identifier">size</span><span class="ruby-operator">&gt;</span><span class="ruby-value">0</span>)<span class="ruby-operator">?</span>(<span class="ruby-value str">&quot;/&quot;</span><span class="ruby-operator">+</span><span class="ruby-identifier">a</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;/&quot;</span>))<span class="ruby-operator">:</span>(<span class="ruby-value str">&quot;&quot;</span>))
148
- 98: <span class="ruby-keyword kw">end</span>
149
+ <span class="ruby-comment cmt"># File lib/capcode.rb, line 91</span>
150
+ 91: <span class="ruby-keyword kw">def</span> <span class="ruby-constant">URL</span>( <span class="ruby-identifier">klass</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">a</span> )
151
+ 92: <span class="ruby-identifier">path</span> = <span class="ruby-keyword kw">nil</span>
152
+ 93: <span class="ruby-identifier">a</span> = <span class="ruby-identifier">a</span>.<span class="ruby-identifier">delete_if</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-identifier">x</span>.<span class="ruby-identifier">nil?</span> }
153
+ 94:
154
+ 95: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Class</span>
155
+ 96: <span class="ruby-constant">Capcode</span>.<span class="ruby-identifier">routes</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">p</span>, <span class="ruby-identifier">k</span><span class="ruby-operator">|</span>
156
+ 97: <span class="ruby-identifier">path</span> = <span class="ruby-identifier">p</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">k</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">klass</span>
157
+ 98: <span class="ruby-keyword kw">end</span>
158
+ 99: <span class="ruby-keyword kw">else</span>
159
+ 100: <span class="ruby-identifier">path</span> = <span class="ruby-identifier">klass</span>
160
+ 101: <span class="ruby-keyword kw">end</span>
161
+ 102:
162
+ 103: <span class="ruby-identifier">path</span><span class="ruby-operator">+</span>((<span class="ruby-identifier">a</span>.<span class="ruby-identifier">size</span><span class="ruby-operator">&gt;</span><span class="ruby-value">0</span>)<span class="ruby-operator">?</span>(<span class="ruby-value str">&quot;/&quot;</span><span class="ruby-operator">+</span><span class="ruby-identifier">a</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;/&quot;</span>))<span class="ruby-operator">:</span>(<span class="ruby-value str">&quot;&quot;</span>))
163
+ 104: <span class="ruby-keyword kw">end</span>
149
164
  </pre>
150
165
  </div>
151
166
  </div>
152
167
  <h4 class="ruled">Public Instance method:
153
- <strong><a name="M000010">json( d )</a></strong> <a href="#M000010"><img src="../../permalink.gif" border="0" title="Permalink to Public Instance method: json" /></a></h4>
168
+ <strong><a name="M000011">json( d )</a></strong> <a href="#M000011"><img src="../../permalink.gif" border="0" title="Permalink to Public Instance method: json" /></a></h4>
154
169
 
155
170
  <p>
156
171
  Help you to return a JSON response
@@ -166,23 +181,23 @@ Help you to return a JSON response
166
181
  </pre>
167
182
 
168
183
  <div class="sourcecode">
169
- <p class="source-link">[ <a href="javascript:toggleSource('M000010_source')" id="l_M000010_source">show source</a> ]</p>
170
- <div id="M000010_source" class="dyn-source">
184
+ <p class="source-link">[ <a href="javascript:toggleSource('M000011_source')" id="l_M000011_source">show source</a> ]</p>
185
+ <div id="M000011_source" class="dyn-source">
171
186
  <pre>
172
- <span class="ruby-comment cmt"># File lib/capcode.rb, line 49</span>
173
- 49: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">json</span>( <span class="ruby-identifier">d</span> )
174
- 50: <span class="ruby-identifier">warn</span>( <span class="ruby-value str">&quot;json is deprecated, please use `render( :json =&gt; ... )'&quot;</span> )
175
- 51: <span class="ruby-ivar">@response</span>[<span class="ruby-value str">'Content-Type'</span>] = <span class="ruby-value str">'application/json'</span>
176
- 52: <span class="ruby-identifier">d</span>.<span class="ruby-identifier">to_json</span>
177
- 53: <span class="ruby-keyword kw">end</span>
187
+ <span class="ruby-comment cmt"># File lib/capcode.rb, line 55</span>
188
+ 55: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">json</span>( <span class="ruby-identifier">d</span> ) <span class="ruby-comment cmt">## DELETE THIS IN 1.0.0</span>
189
+ 56: <span class="ruby-identifier">warn</span>( <span class="ruby-value str">&quot;json is deprecated, please use `render( :json =&gt; ... )'&quot;</span> )
190
+ 57: <span class="ruby-ivar">@response</span>[<span class="ruby-value str">'Content-Type'</span>] = <span class="ruby-value str">'application/json'</span>
191
+ 58: <span class="ruby-identifier">d</span>.<span class="ruby-identifier">to_json</span>
192
+ 59: <span class="ruby-keyword kw">end</span>
178
193
  </pre>
179
194
  </div>
180
195
  </div>
181
196
  <h4 class="ruled">Public Instance method:
182
- <strong><a name="M000011">redirect( klass, *a )</a></strong> <a href="#M000011"><img src="../../permalink.gif" border="0" title="Permalink to Public Instance method: redirect" /></a></h4>
197
+ <strong><a name="M000012">redirect( klass, *a )</a></strong> <a href="#M000012"><img src="../../permalink.gif" border="0" title="Permalink to Public Instance method: redirect" /></a></h4>
183
198
 
184
199
  <p>
185
- Send a <a href="Helpers.html#M000011">redirect</a> response
200
+ Send a <a href="Helpers.html#M000012">redirect</a> response
186
201
  </p>
187
202
  <pre>
188
203
  module Capcode
@@ -199,41 +214,41 @@ Send a <a href="Helpers.html#M000011">redirect</a> response
199
214
  </pre>
200
215
 
201
216
  <div class="sourcecode">
202
- <p class="source-link">[ <a href="javascript:toggleSource('M000011_source')" id="l_M000011_source">show source</a> ]</p>
203
- <div id="M000011_source" class="dyn-source">
217
+ <p class="source-link">[ <a href="javascript:toggleSource('M000012_source')" id="l_M000012_source">show source</a> ]</p>
218
+ <div id="M000012_source" class="dyn-source">
204
219
  <pre>
205
- <span class="ruby-comment cmt"># File lib/capcode.rb, line 68</span>
206
- 68: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">redirect</span>( <span class="ruby-identifier">klass</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">a</span> )
207
- 69: [<span class="ruby-value">302</span>, {<span class="ruby-value str">'Location'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">URL</span>(<span class="ruby-identifier">klass</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">a</span>)}, <span class="ruby-value str">''</span>]
208
- 70: <span class="ruby-keyword kw">end</span>
220
+ <span class="ruby-comment cmt"># File lib/capcode.rb, line 74</span>
221
+ 74: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">redirect</span>( <span class="ruby-identifier">klass</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">a</span> )
222
+ 75: [<span class="ruby-value">302</span>, {<span class="ruby-value str">'Location'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">URL</span>(<span class="ruby-identifier">klass</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">a</span>)}, <span class="ruby-value str">''</span>]
223
+ 76: <span class="ruby-keyword kw">end</span>
209
224
  </pre>
210
225
  </div>
211
226
  </div>
212
227
  <h4 class="ruled">Public Instance method:
213
- <strong><a name="M000009">render( h )</a></strong> <a href="#M000009"><img src="../../permalink.gif" border="0" title="Permalink to Public Instance method: render" /></a></h4>
228
+ <strong><a name="M000010">render( h )</a></strong> <a href="#M000010"><img src="../../permalink.gif" border="0" title="Permalink to Public Instance method: render" /></a></h4>
214
229
 
215
230
  <p>
216
231
  Render a view
217
232
  </p>
218
233
 
219
234
  <div class="sourcecode">
220
- <p class="source-link">[ <a href="javascript:toggleSource('M000009_source')" id="l_M000009_source">show source</a> ]</p>
221
- <div id="M000009_source" class="dyn-source">
235
+ <p class="source-link">[ <a href="javascript:toggleSource('M000010_source')" id="l_M000010_source">show source</a> ]</p>
236
+ <div id="M000010_source" class="dyn-source">
222
237
  <pre>
223
- <span class="ruby-comment cmt"># File lib/capcode.rb, line 25</span>
224
- 25: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">render</span>( <span class="ruby-identifier">h</span> )
225
- 26: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">h</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Hash</span>
226
- 27: <span class="ruby-identifier">t</span> = (<span class="ruby-identifier">h</span>.<span class="ruby-identifier">keys</span>)[<span class="ruby-value">0</span>]
227
- 28: <span class="ruby-identifier">v</span> = <span class="ruby-identifier">h</span>[<span class="ruby-identifier">t</span>]
228
- 29: <span class="ruby-keyword kw">begin</span>
229
- 30: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">send</span>( <span class="ruby-node">&quot;render_#{t.to_s}&quot;</span>, <span class="ruby-identifier">v</span> )
230
- 31: <span class="ruby-keyword kw">rescue</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
231
- 32: <span class="ruby-identifier">raise</span> <span class="ruby-constant">Capcode</span><span class="ruby-operator">::</span><span class="ruby-constant">RenderError</span>, <span class="ruby-node">&quot;Error rendering `#{t.to_s}' : #{e.message}&quot;</span>, <span class="ruby-identifier">caller</span>
232
- 33: <span class="ruby-keyword kw">end</span>
233
- 34: <span class="ruby-keyword kw">else</span>
234
- 35: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">h</span>.<span class="ruby-identifier">to_s</span>)
235
- 36: <span class="ruby-keyword kw">end</span>
236
- 37: <span class="ruby-keyword kw">end</span>
238
+ <span class="ruby-comment cmt"># File lib/capcode.rb, line 31</span>
239
+ 31: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">render</span>( <span class="ruby-identifier">h</span> )
240
+ 32: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">h</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Hash</span>
241
+ 33: <span class="ruby-identifier">t</span> = (<span class="ruby-identifier">h</span>.<span class="ruby-identifier">keys</span>)[<span class="ruby-value">0</span>]
242
+ 34: <span class="ruby-identifier">v</span> = <span class="ruby-identifier">h</span>[<span class="ruby-identifier">t</span>]
243
+ 35: <span class="ruby-keyword kw">begin</span>
244
+ 36: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">send</span>( <span class="ruby-node">&quot;render_#{t.to_s}&quot;</span>, <span class="ruby-identifier">v</span> )
245
+ 37: <span class="ruby-keyword kw">rescue</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
246
+ 38: <span class="ruby-identifier">raise</span> <span class="ruby-constant">Capcode</span><span class="ruby-operator">::</span><span class="ruby-constant">RenderError</span>, <span class="ruby-node">&quot;Error rendering `#{t.to_s}' : #{e.message}&quot;</span>, <span class="ruby-identifier">caller</span>
247
+ 39: <span class="ruby-keyword kw">end</span>
248
+ 40: <span class="ruby-keyword kw">else</span>
249
+ 41: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">h</span>.<span class="ruby-identifier">to_s</span>)
250
+ 42: <span class="ruby-keyword kw">end</span>
251
+ 43: <span class="ruby-keyword kw">end</span>
237
252
  </pre>
238
253
  </div>
239
254
  </div>
@@ -0,0 +1,129 @@
1
+
2
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
3
+ <html>
4
+ <head>
5
+ <title>
6
+ Capcode, the Documentation &raquo; Class: Capcode::RenderError
7
+ </title>
8
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
9
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
10
+ <script language="JavaScript" type="text/javascript">
11
+ // <![CDATA[
12
+
13
+ function toggleSource( id )
14
+ {
15
+ var elem
16
+ var link
17
+
18
+ if( document.getElementById )
19
+ {
20
+ elem = document.getElementById( id )
21
+ link = document.getElementById( "l_" + id )
22
+ }
23
+ else if ( document.all )
24
+ {
25
+ elem = eval( "document.all." + id )
26
+ link = eval( "document.all.l_" + id )
27
+ }
28
+ else
29
+ return false;
30
+
31
+ if( elem.style.display == "block" )
32
+ {
33
+ elem.style.display = "none"
34
+ link.innerHTML = "show source"
35
+ }
36
+ else
37
+ {
38
+ elem.style.display = "block"
39
+ link.innerHTML = "hide source"
40
+ }
41
+ }
42
+
43
+ function openCode( url )
44
+ {
45
+ window.open( url, "SOURCE_CODE", "width=400,height=400,scrollbars=yes" )
46
+ }
47
+ // ]]>
48
+ </script>
49
+ </head>
50
+ <body>
51
+ <!--
52
+ <div id="menu">
53
+ <h3 class="title">Class: Capcode::RenderError</h3>
54
+ </div>
55
+ -->
56
+ <div id="fullpage">
57
+ <div id="pager">
58
+ <table>
59
+ <tr><td><img src="../../rubyfr.png" /></td>
60
+ <td id="pagertd">
61
+ <strong># Class: Capcode::RenderError<br />
62
+ [
63
+ "<a href="../../files/README.html" value="File: README">README</a>",
64
+ "<a href="../../files/AUTHORS.html" value="File: AUTHORS">AUTHORS</a>",
65
+ "<a href="../../files/COPYING.html" value="File: COPYING">COPYING</a>",
66
+ "<a href="../../files/lib/capcode_rb.html" value="File: capcode.rb">lib/capcode.rb</a>",
67
+ <a href="http://greg.rubyfr.net">nil</a>].each do<br />
68
+ <a href="../../classes/Capcode.html" title="Module: Capcode">Capcode</a>.view_html<br />
69
+ <a href="../../classes/Capcode/Views.html" title="Module: Capcode::Views">Capcode::Views</a>.view_html<br />
70
+ <a href="../../classes/Capcode/Helpers.html" title="Module: Capcode::Helpers">Capcode::Helpers</a>.view_html<br />
71
+ <a href="../../classes/Capcode/HTTPError.html" title="Class: Capcode::HTTPError">Capcode::HTTPError</a>.view_html<br />
72
+ <a href="../../classes/Capcode/RenderError.html" title="Class: Capcode::RenderError">Capcode::RenderError</a>.view_html<br />
73
+ <a href="../../classes/Capcode/RouteError.html" title="Class: Capcode::RouteError">Capcode::RouteError</a>.view_html<br />
74
+ <a href="../../classes/Capcode/ParameterError.html" title="Class: Capcode::ParameterError">Capcode::ParameterError</a>.view_html<br />
75
+ end</strong>
76
+ </td></tr>
77
+ </table>
78
+ </ul>
79
+ </div>
80
+
81
+
82
+ <div id="Capcode::RenderError" class="page_shade">
83
+ <div class="page">
84
+ <h3>Class Capcode::RenderError &lt; ArgumentError</h3>
85
+
86
+ (in files
87
+ <a href="../../files/lib/capcode_rb.html">lib/capcode.rb</a>
88
+ )
89
+
90
+ <p>
91
+ <a href="HTTPError.html">HTTPError</a> help you to create your own 404, 500
92
+ and/or 501 response
93
+ </p>
94
+ <p>
95
+ To create a custom 404 reponse, create a fonction HTTPError.r404 in your
96
+ application :
97
+ </p>
98
+ <pre>
99
+ module Capcode
100
+ class HTTPError
101
+ def r404(f)
102
+ &quot;#{f} not found :(&quot;
103
+ end
104
+ end
105
+ end
106
+ </pre>
107
+ <p>
108
+ Do the same (r500, r501, r403) to customize 500, 501, 403 errors
109
+ </p>
110
+
111
+
112
+
113
+
114
+ <h4>Includes</h4>
115
+ <ul>
116
+ <li>Rack</li>
117
+ <li><a href="Capcode/Helpers.html">Capcode::Helpers</a></li>
118
+ <li><a href="Capcode/Views.html">Capcode::Views</a></li>
119
+ </ul>
120
+
121
+
122
+
123
+ </div>
124
+ </div>
125
+
126
+
127
+ </div>
128
+ </body>
129
+ </html>
@@ -1 +1 @@
1
- Thu, 07 May 2009 17:10:30 +0200
1
+ Mon, 08 Jun 2009 16:18:53 +0200
@@ -81,7 +81,7 @@ end</strong>
81
81
  <div id="README" class="page_shade">
82
82
  <div class="page">
83
83
  <div class="header">
84
- <div class="path">README / Thu May 07 15:41:00 +0200 2009</div>
84
+ <div class="path">README / Mon Jun 08 16:06:13 +0200 2009</div>
85
85
  </div>
86
86
 
87
87
  <h1><a href="../classes/Capcode.html">Capcode</a></h1>
@@ -98,6 +98,29 @@ Copyright (C) 2009 Gregoire Lejeune
98
98
  <a href="../classes/Capcode.html">Capcode</a> is a web microframework
99
99
  </p>
100
100
  <h2>FEATURES/PROBLEMS:</h2>
101
+ <h3>0.5.1</h3>
102
+ <ul>
103
+ <li>Add :root option to <a
104
+ href="../classes/Capcode.html#M000008">Capcode.run</a>. This option allow
105
+ you to specify the root directory for static files
106
+
107
+ </li>
108
+ <li>Add :working_directory option to <a
109
+ href="../classes/Capcode.html#M000008">Capcode.run</a>. This option allow
110
+ you to specify the working directory
111
+
112
+ </li>
113
+ <li>Of &#8217;/&#8217; route is not defined but /index.html exist, display
114
+ index
115
+
116
+ </li>
117
+ <li>add mime-types dependency
118
+
119
+ </li>
120
+ <li>Bug correction in erb and haml renderer
121
+
122
+ </li>
123
+ </ul>
101
124
  <h3>0.5.0</h3>
102
125
  <ul>
103
126
  <li>Add Haml and Markaby renderer
@@ -273,47 +296,47 @@ for complete examples.
273
296
  </pre>
274
297
  <h3>Render with Haml</h3>
275
298
  <pre>
276
- # file: sample.rb
277
- require 'rubygems'
278
- require 'capcode'
279
- require 'capcode/render/haml'
280
- Capcode::Helpers.haml_path = &quot;./my_haml_views&quot;
281
-
282
- module Capcode
283
- class Hello &lt; Route '/hello'
284
- def get
285
- @t = Time.now
286
- render :haml =&gt; :time
287
- end
288
- end
289
- end
299
+ # file: sample.rb
300
+ require 'rubygems'
301
+ require 'capcode'
302
+ require 'capcode/render/haml'
303
+ Capcode::Helpers.haml_path = &quot;./my_haml_views&quot;
304
+
305
+ module Capcode
306
+ class Hello &lt; Route '/hello'
307
+ def get
308
+ @t = Time.now
309
+ render :haml =&gt; :time
310
+ end
311
+ end
312
+ end
290
313
 
291
- Capcode.run( )
314
+ Capcode.run( )
292
315
 
293
- # ./my_haml_views/time.haml
294
- %html
295
- %body
296
- %p
297
- Hello World
298
- = @t
316
+ # ./my_haml_views/time.haml
317
+ %html
318
+ %body
319
+ %p
320
+ Hello World
321
+ = @t
299
322
  </pre>
300
323
  <h3>Render with JSON</h3>
301
324
  <pre>
302
- # file: sample.rb
303
- require 'rubygems'
304
- require 'capcode'
305
- require 'capcode/render/json'
306
-
307
- module Capcode
308
- class Hello &lt; Route '/hello'
309
- def get
310
- @t = Time.now
311
- render :json =&gt; { :time =&gt; @t }
312
- end
313
- end
314
- end
325
+ # file: sample.rb
326
+ require 'rubygems'
327
+ require 'capcode'
328
+ require 'capcode/render/json'
315
329
 
316
- Capcode.run( )
330
+ module Capcode
331
+ class Hello &lt; Route '/hello'
332
+ def get
333
+ @t = Time.now
334
+ render :json =&gt; { :time =&gt; @t }
335
+ end
336
+ end
337
+ end
338
+
339
+ Capcode.run( )
317
340
  </pre>
318
341
  <h2>REQUIREMENTS:</h2>
319
342
  <ul>
@@ -81,7 +81,7 @@ end</strong>
81
81
  <div id="lib/capcode.rb" class="page_shade">
82
82
  <div class="page">
83
83
  <div class="header">
84
- <div class="path">lib/capcode.rb / Thu May 07 15:33:01 +0200 2009</div>
84
+ <div class="path">lib/capcode.rb / Mon Jun 08 16:18:06 +0200 2009</div>
85
85
  </div>
86
86
 
87
87
  <pre>
@@ -519,6 +519,7 @@ License instead of this License.
519
519
  <li>rack</li>
520
520
  <li>json</li>
521
521
  <li>logger</li>
522
+ <li>mime/types</li>
522
523
  <li>capcode/version</li>
523
524
  <li>capcode/core_ext</li>
524
525
  <li>mongrel</li>