merb 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,128 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
- <head>
8
- <title>Module: Merb</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
- <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
12
- <script type="text/javascript">
13
- // <![CDATA[
14
-
15
- function popupCode( url ) {
16
- window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
- }
18
-
19
- function toggleCode( id ) {
20
- if ( document.getElementById )
21
- elem = document.getElementById( id );
22
- else if ( document.all )
23
- elem = eval( "document.all." + id );
24
- else
25
- return false;
26
-
27
- elemStyle = elem.style;
28
-
29
- if ( elemStyle.display != "block" ) {
30
- elemStyle.display = "block"
31
- } else {
32
- elemStyle.display = "none"
33
- }
34
-
35
- return true;
36
- }
37
-
38
- // Make codeblocks hidden by default
39
- document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
-
41
- // ]]>
42
- </script>
43
-
44
- </head>
45
- <body>
46
-
47
-
48
-
49
- <div id="classHeader">
50
- <table class="header-table">
51
- <tr class="top-aligned-row">
52
- <td><strong>Module</strong></td>
53
- <td class="class-name-in-header">Merb</td>
54
- </tr>
55
- <tr class="top-aligned-row">
56
- <td><strong>In:</strong></td>
57
- <td>
58
- <a href="../files/lib/merb_rb.html">
59
- lib/merb.rb
60
- </a>
61
- <br />
62
- <a href="../files/lib/merb_config_rb.html">
63
- lib/merb_config.rb
64
- </a>
65
- <br />
66
- </td>
67
- </tr>
68
-
69
- </table>
70
- </div>
71
- <!-- banner header -->
72
-
73
- <div id="bodyContent">
74
-
75
-
76
-
77
- <div id="contextContent">
78
-
79
-
80
-
81
- </div>
82
-
83
-
84
- </div>
85
-
86
-
87
- <!-- if includes -->
88
-
89
- <div id="section">
90
-
91
- <div id="class-list">
92
- <h3 class="section-bar">Classes and Modules</h3>
93
-
94
- Class <a href="Merb/Config.html" class="link">Merb::Config</a><br />
95
-
96
- </div>
97
-
98
- <div id="constants-list">
99
- <h3 class="section-bar">Constants</h3>
100
-
101
- <div class="name-list">
102
- <table summary="Constants">
103
- <tr class="top-aligned-row context-row">
104
- <td class="context-item-name">VERSION</td>
105
- <td>=</td>
106
- <td class="context-item-value">'0.0.2' unless defined?VERSION</td>
107
- </tr>
108
- </table>
109
- </div>
110
- </div>
111
-
112
-
113
-
114
-
115
-
116
-
117
- <!-- if method_list -->
118
-
119
-
120
- </div>
121
-
122
-
123
- <div id="validator-badges">
124
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
125
- </div>
126
-
127
- </body>
128
- </html>
data/doc/rdoc/created.rid DELETED
@@ -1 +0,0 @@
1
- Mon Oct 16 20:09:10 -0700 2006
@@ -1,129 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
- <head>
8
- <title>File: LICENSE</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
- <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
12
- <script type="text/javascript">
13
- // <![CDATA[
14
-
15
- function popupCode( url ) {
16
- window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
- }
18
-
19
- function toggleCode( id ) {
20
- if ( document.getElementById )
21
- elem = document.getElementById( id );
22
- else if ( document.all )
23
- elem = eval( "document.all." + id );
24
- else
25
- return false;
26
-
27
- elemStyle = elem.style;
28
-
29
- if ( elemStyle.display != "block" ) {
30
- elemStyle.display = "block"
31
- } else {
32
- elemStyle.display = "none"
33
- }
34
-
35
- return true;
36
- }
37
-
38
- // Make codeblocks hidden by default
39
- document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
-
41
- // ]]>
42
- </script>
43
-
44
- </head>
45
- <body>
46
-
47
-
48
-
49
- <div id="fileHeader">
50
- <h1>LICENSE</h1>
51
- <table class="header-table">
52
- <tr class="top-aligned-row">
53
- <td><strong>Path:</strong></td>
54
- <td>LICENSE
55
- </td>
56
- </tr>
57
- <tr class="top-aligned-row">
58
- <td><strong>Last Update:</strong></td>
59
- <td>Sat Oct 14 14:18:28 -0700 2006</td>
60
- </tr>
61
- </table>
62
- </div>
63
- <!-- banner header -->
64
-
65
- <div id="bodyContent">
66
-
67
-
68
-
69
- <div id="contextContent">
70
-
71
- <div id="description">
72
- <p>
73
- Copyright (c) 2006 Ezra Zygmuntowicz
74
- </p>
75
- <p>
76
- Permission is hereby granted, free of charge, to any person obtaining a
77
- copy of this software and associated documentation files (the
78
- &quot;Software&quot;), to deal in the Software without restriction,
79
- including without limitation the rights to use, copy, modify, merge,
80
- publish, distribute, sublicense, and/or sell copies of the Software, and to
81
- permit persons to whom the Software is furnished to do so, subject to the
82
- following conditions:
83
- </p>
84
- <p>
85
- The above copyright notice and this permission notice shall be included in
86
- all copies or substantial portions of the Software.
87
- </p>
88
- <p>
89
- THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND,
90
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
91
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
92
- NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
93
- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
94
- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
95
- USE OR OTHER DEALINGS IN THE SOFTWARE.
96
- </p>
97
-
98
- </div>
99
-
100
-
101
- </div>
102
-
103
-
104
- </div>
105
-
106
-
107
- <!-- if includes -->
108
-
109
- <div id="section">
110
-
111
-
112
-
113
-
114
-
115
-
116
-
117
-
118
- <!-- if method_list -->
119
-
120
-
121
- </div>
122
-
123
-
124
- <div id="validator-badges">
125
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
126
- </div>
127
-
128
- </body>
129
- </html>
@@ -1,297 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
- <head>
8
- <title>File: README</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
- <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
12
- <script type="text/javascript">
13
- // <![CDATA[
14
-
15
- function popupCode( url ) {
16
- window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
- }
18
-
19
- function toggleCode( id ) {
20
- if ( document.getElementById )
21
- elem = document.getElementById( id );
22
- else if ( document.all )
23
- elem = eval( "document.all." + id );
24
- else
25
- return false;
26
-
27
- elemStyle = elem.style;
28
-
29
- if ( elemStyle.display != "block" ) {
30
- elemStyle.display = "block"
31
- } else {
32
- elemStyle.display = "none"
33
- }
34
-
35
- return true;
36
- }
37
-
38
- // Make codeblocks hidden by default
39
- document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
-
41
- // ]]>
42
- </script>
43
-
44
- </head>
45
- <body>
46
-
47
-
48
-
49
- <div id="fileHeader">
50
- <h1>README</h1>
51
- <table class="header-table">
52
- <tr class="top-aligned-row">
53
- <td><strong>Path:</strong></td>
54
- <td>README
55
- </td>
56
- </tr>
57
- <tr class="top-aligned-row">
58
- <td><strong>Last Update:</strong></td>
59
- <td>Sun Oct 15 16:21:25 -0700 2006</td>
60
- </tr>
61
- </table>
62
- </div>
63
- <!-- banner header -->
64
-
65
- <div id="bodyContent">
66
-
67
-
68
-
69
- <div id="contextContent">
70
-
71
- <div id="description">
72
- <p>
73
- &lt;html&gt;&lt;body&gt; &lt;pre&gt; Copyright (c) 2006 Ezra Zygmuntowicz
74
- </p>
75
- <p>
76
- <a href="../classes/Merb.html">Merb</a>. Mongrel+Erb
77
- </p>
78
- <p>
79
- Little bitty lightweight ruby app server. FOr when you really need
80
- performance for simple dynamic pages.
81
- </p>
82
- <p>
83
- **Sample APP included**
84
- </p>
85
- <p>
86
- Unpack the gem and grab the sample app
87
- </p>
88
- <p>
89
- $ gem unpack merb
90
- </p>
91
- <p>
92
- cd merb* cd examples/smaple_app
93
- </p>
94
- <p>
95
- $ merb start -t
96
- </p>
97
- <p>
98
- then the sample app will be running on port 4000 in the foreground. you can
99
- go to a few urls:
100
- </p>
101
- <p>
102
- <a
103
- href="http://localhost:4000/upload/start">localhost:4000/upload/start</a>
104
- </p>
105
- <p>
106
- <a
107
- href="http://localhost:4000/foo/123/baz/12234345">localhost:4000/foo/123/baz/12234345</a>
108
- </p>
109
- <p>
110
- *<b>FEATURES</b>* 1. Mongrel handler built in that parses incoming requests
111
- including multipart uploads and post as well as ?query=strings. Puts the
112
- params into @params and the cookies into @cookies when it instantiates your
113
- controller class.
114
- </p>
115
- <ol>
116
- <li>New RouteMatcher and route compiler. Reads your route definition and
117
- compiles
118
-
119
- </li>
120
- </ol>
121
- <p>
122
- a method on the fly that will match the request path against each route and
123
- do the right thing. So the following routes:
124
- </p>
125
- <p>
126
- Merb::RouteMatcher.prepare do |r|
127
- </p>
128
- <pre>
129
- r.add '/foo/:bar/baz/:id', :class =&gt; 'Test', :method =&gt; 'foo'
130
- r.add '/hey/:there/you/:guys', :class =&gt; 'Test', :method =&gt; 'hello'
131
- r.add '/:class/:method/:id', {}
132
- r.add '/:class/:method', {}
133
- r.add '.*', {:class =&gt; 'NoRouteFound', :method =&gt; 'noroute'}
134
- </pre>
135
- <p>
136
- end
137
- </p>
138
- <p>
139
- Will be compiled and defined as a method with this lambda as the body:
140
- </p>
141
- <p>
142
- lambda{|path|
143
- </p>
144
- <pre>
145
- if Regexp.new('/foo/(.+)/baz/(.+)') =~ path
146
- @sections[:bar] = $1
147
- @sections[:id] = $2
148
- return {:class=&gt;&quot;Test&quot;, :method=&gt;&quot;foo&quot;}.merge(@sections)
149
- end
150
-
151
- if Regexp.new('/hey/(.+)/you/(.+)') =~ path
152
- @sections[:there] = $1
153
- @sections[:guys] = $2
154
- return {:class=&gt;&quot;Test&quot;, :method=&gt;&quot;hello&quot;}.merge(@sections)
155
- end
156
-
157
- if Regexp.new('/(.+)/(.+)/(.+)') =~ path
158
- @sections[:class] = $1
159
- @sections[:method] = $2
160
- @sections[:id] = $3
161
- return {}.merge(@sections)
162
- end
163
-
164
- if Regexp.new('/(.+)/(.+)') =~ path
165
- @sections[:class] = $1
166
- @sections[:method] = $2
167
- return {}.merge(@sections)
168
- end
169
-
170
- if Regexp.new('.*') =~ path
171
- return {:class=&gt;&quot;NoRouteFound&quot;, :method=&gt;&quot;noroute&quot;}.merge(@sections)
172
- end
173
-
174
- return default_route
175
- </pre>
176
- <p>
177
- }
178
- </p>
179
- <ol>
180
- <li>Simple controller classes with built in render method and template handling
181
-
182
- </li>
183
- </ol>
184
- <p>
185
- with instance vars available in the views automatically.
186
- </p>
187
- <p>
188
- class Test &lt; Merb::Controller
189
- </p>
190
- <pre>
191
- template_dir :test
192
-
193
- def hello(args)
194
- # args is a hash of the remaining templated
195
- # parameters from the url matched in routing.
196
- # @params and @cookies are avaialable here. string
197
- # keys and not symbols just yet.
198
- # Assign the parameter to an instance variable
199
- @name = args[:name]
200
- render
201
- end
202
- </pre>
203
- <p>
204
- end
205
- </p>
206
- <p>
207
- &lt;html&gt;
208
- </p>
209
- <pre>
210
- &lt;head&gt;
211
- &lt;title&gt;Hello, &lt;%= @name %&gt;&lt;/title&gt;
212
- &lt;/head&gt;
213
- &lt;body&gt;
214
- &lt;h1&gt;&lt;%= @params.inspect %&gt;&lt;/h1&gt;
215
- &lt;h1&gt;&lt;%= @cookies.inspect %&gt;&lt;/h1&gt;
216
- &lt;% 5.times do %&gt;
217
- &lt;h1&gt;Hello, &lt;%= @name %&gt;!&lt;/h1&gt;
218
- &lt;% end %&gt;
219
- &lt;/body&gt;
220
- </pre>
221
- <p>
222
- &lt;/html&gt;
223
- </p>
224
- <ol>
225
- <li>the server. right now you add your routes in
226
-
227
- </li>
228
- </ol>
229
- <p>
230
- the appdir/conf/router.rb file. So by default it runs on port 4000
231
- </p>
232
- <p>
233
- $ cd /path/to/your/merb/app $ merb start
234
- </p>
235
- <ol>
236
- <li>File uploads. This is the thing that <a
237
- href="../classes/Merb.html">Merb</a> was written for. Rails doesn&#8216;t
238
- allow
239
-
240
- </li>
241
- </ol>
242
- <p>
243
- multiple concurrent file uploads at once without blocking an entire rails
244
- backend for each file upload. <a href="../classes/Merb.html">Merb</a>
245
- allows multiple file uploads at once. Start the server and browse to <a
246
- href="http://localhost:4000/upload/start">localhost:4000/upload/start</a>
247
- and you will get a file upload form. There is a very simple upload
248
- controller example that handles this upload. When a file is uploaded with
249
- <a href="../classes/Merb.html">Merb</a>, it gets put in a Tempfile. So you
250
- just want to copy it to the right place on the filesystem.
251
- </p>
252
- <p>
253
- def upload(args)
254
- </p>
255
- <pre>
256
- puts @params[:file].inspect
257
-
258
- FileUtils.mv @params[:file][:tempfile].path, MERB_ROOT+&quot;/uploads/#{@params[:file][:filename]}&quot;
259
-
260
- render
261
- </pre>
262
- <p>
263
- end &lt;/pre&gt; &lt;/body&gt; &lt;/html&gt;
264
- </p>
265
-
266
- </div>
267
-
268
-
269
- </div>
270
-
271
-
272
- </div>
273
-
274
-
275
- <!-- if includes -->
276
-
277
- <div id="section">
278
-
279
-
280
-
281
-
282
-
283
-
284
-
285
-
286
- <!-- if method_list -->
287
-
288
-
289
- </div>
290
-
291
-
292
- <div id="validator-badges">
293
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
294
- </div>
295
-
296
- </body>
297
- </html>
@@ -1,101 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
- <head>
8
- <title>File: merb_config.rb</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
- <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
12
- <script type="text/javascript">
13
- // <![CDATA[
14
-
15
- function popupCode( url ) {
16
- window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
- }
18
-
19
- function toggleCode( id ) {
20
- if ( document.getElementById )
21
- elem = document.getElementById( id );
22
- else if ( document.all )
23
- elem = eval( "document.all." + id );
24
- else
25
- return false;
26
-
27
- elemStyle = elem.style;
28
-
29
- if ( elemStyle.display != "block" ) {
30
- elemStyle.display = "block"
31
- } else {
32
- elemStyle.display = "none"
33
- }
34
-
35
- return true;
36
- }
37
-
38
- // Make codeblocks hidden by default
39
- document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
-
41
- // ]]>
42
- </script>
43
-
44
- </head>
45
- <body>
46
-
47
-
48
-
49
- <div id="fileHeader">
50
- <h1>merb_config.rb</h1>
51
- <table class="header-table">
52
- <tr class="top-aligned-row">
53
- <td><strong>Path:</strong></td>
54
- <td>lib/merb_config.rb
55
- </td>
56
- </tr>
57
- <tr class="top-aligned-row">
58
- <td><strong>Last Update:</strong></td>
59
- <td>Sun Oct 15 15:43:45 -0700 2006</td>
60
- </tr>
61
- </table>
62
- </div>
63
- <!-- banner header -->
64
-
65
- <div id="bodyContent">
66
-
67
-
68
-
69
- <div id="contextContent">
70
-
71
-
72
-
73
- </div>
74
-
75
-
76
- </div>
77
-
78
-
79
- <!-- if includes -->
80
-
81
- <div id="section">
82
-
83
-
84
-
85
-
86
-
87
-
88
-
89
-
90
- <!-- if method_list -->
91
-
92
-
93
- </div>
94
-
95
-
96
- <div id="validator-badges">
97
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
98
- </div>
99
-
100
- </body>
101
- </html>