merb 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README +41 -2
- data/Rakefile +4 -2
- data/TODO +3 -3
- data/bin/merb +157 -3
- data/doc/rdoc/classes/Hash.html +4 -4
- data/doc/rdoc/classes/Merb.html +2 -12
- data/doc/rdoc/classes/Merb/Controller.html +347 -156
- data/doc/rdoc/classes/Merb/RouteMatcher.html +93 -59
- data/doc/rdoc/classes/MerbHandler.html +117 -107
- data/doc/rdoc/classes/MerbHash.html +64 -58
- data/doc/rdoc/classes/Noroutefound.html +16 -10
- data/doc/rdoc/classes/Object.html +5 -5
- data/doc/rdoc/classes/String.html +28 -16
- data/doc/rdoc/classes/Symbol.html +15 -8
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/README.html +56 -4
- data/doc/rdoc/files/TODO.html +4 -4
- data/doc/rdoc/files/lib/merb/merb_controller_rb.html +1 -1
- data/doc/rdoc/files/lib/merb/merb_handler_rb.html +1 -1
- data/doc/rdoc/files/lib/merb/merb_router_rb.html +1 -1
- data/doc/rdoc/files/lib/merb/merb_utils_rb.html +1 -1
- data/doc/rdoc/files/lib/merb_rb.html +30 -2
- data/doc/rdoc/files/lib/{merb_config_rb.html → merb_tasks_rb.html} +4 -4
- data/doc/rdoc/fr_class_index.html +0 -2
- data/doc/rdoc/fr_file_index.html +1 -3
- data/doc/rdoc/fr_method_index.html +21 -21
- data/examples/app_skeleton/Rakefile +81 -0
- data/examples/app_skeleton/dist/conf/merb_init.rb +15 -0
- data/examples/{skeleton → app_skeleton}/dist/conf/router.rb +5 -7
- data/examples/app_skeleton/scripts/merb_stop +5 -0
- data/examples/app_skeleton/scripts/new_migration +21 -0
- data/examples/{skeleton → app_skeleton}/test/test_helper.rb +0 -0
- data/examples/sample_app/Rakefile +81 -0
- data/examples/sample_app/dist/app/controllers/posts.rb +26 -10
- data/examples/sample_app/dist/app/models/comment.rb +3 -0
- data/examples/sample_app/dist/app/models/post.rb +2 -11
- data/examples/sample_app/dist/app/views/layout/application.rhtml +59 -4
- data/examples/sample_app/dist/app/views/posts/_comments.rhtml +11 -0
- data/examples/sample_app/dist/app/views/posts/comment.merbjs +1 -0
- data/examples/sample_app/dist/app/views/posts/list.rhtml +2 -4
- data/examples/sample_app/dist/app/views/posts/new.rhtml +2 -2
- data/examples/sample_app/dist/app/views/posts/show.rhtml +35 -3
- data/examples/sample_app/dist/conf/merb_init.rb +2 -4
- data/examples/sample_app/dist/conf/router.rb +3 -4
- data/examples/sample_app/dist/public/images/bg.jpg +0 -0
- data/examples/sample_app/dist/public/images/book.gif +0 -0
- data/examples/sample_app/dist/public/images/booksmall.gif +0 -0
- data/examples/sample_app/dist/public/images/greenright.jpg +0 -0
- data/examples/sample_app/dist/public/images/louiecon.gif +0 -0
- data/examples/sample_app/dist/public/images/menu.gif +0 -0
- data/examples/sample_app/dist/public/images/menuleft.gif +0 -0
- data/examples/sample_app/dist/public/images/menuright.gif +0 -0
- data/examples/sample_app/dist/public/images/mountain.jpg +0 -0
- data/examples/sample_app/dist/public/images/n3.jpg +0 -0
- data/examples/sample_app/dist/public/images/nautica.jpg +0 -0
- data/examples/sample_app/dist/public/javascripts/application.js +0 -0
- data/examples/sample_app/dist/public/javascripts/effects.js +975 -0
- data/examples/sample_app/dist/public/javascripts/prototype.js +2264 -0
- data/examples/sample_app/dist/public/stylesheets/merb.css +277 -0
- data/examples/sample_app/dist/schema/migrations/001_add_comments_to_posts.rb +22 -0
- data/examples/sample_app/dist/schema/schema.rb +22 -0
- data/examples/sample_app/log/merb.log +164394 -0
- data/examples/sample_app/script/merb_stop +9 -0
- data/examples/sample_app/script/new_migration +21 -0
- data/lib/merb.rb +7 -4
- data/lib/merb/merb_controller.rb +83 -4
- data/lib/merb/merb_handler.rb +20 -9
- data/lib/merb/merb_router.rb +18 -1
- data/lib/merb/merb_utils.rb +11 -1
- data/lib/merb_tasks.rb +7 -0
- data/lib/tasks/db.rake +53 -0
- metadata +67 -34
- data/doc/rdoc/classes/Merb/Config.html +0 -161
- data/doc/rdoc/classes/Merb/Server.html +0 -288
- data/doc/rdoc/files/lib/merb/merb_daemon_rb.html +0 -113
- data/doc/rdoc/files/lib/merb/noroutefound_rb.html +0 -101
- data/examples/sample_app/dist/app/views/layout/posts.rhtml +0 -6
- data/examples/skeleton/dist/conf/merb_init.rb +0 -21
- data/lib/merb/merb_daemon.rb +0 -91
- data/lib/merb/noroutefound.rb +0 -11
- data/lib/merb_config.rb +0 -21
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
|
|
3
3
|
specification_version: 1
|
4
4
|
name: merb
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.0.
|
7
|
-
date: 2006-
|
6
|
+
version: 0.0.5
|
7
|
+
date: 2006-11-01 00:00:00 -08:00
|
8
8
|
summary: Merb == Mongrel + Erb. Pocket rocket web framework.
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -52,53 +52,81 @@ files:
|
|
52
52
|
- doc/rdoc/classes/Object.html
|
53
53
|
- doc/rdoc/classes/String.html
|
54
54
|
- doc/rdoc/classes/Symbol.html
|
55
|
-
- doc/rdoc/classes/Merb/Config.html
|
56
55
|
- doc/rdoc/classes/Merb/Controller.html
|
57
56
|
- doc/rdoc/classes/Merb/RouteMatcher.html
|
58
|
-
- doc/rdoc/classes/Merb/Server.html
|
59
57
|
- doc/rdoc/files/lib
|
60
58
|
- doc/rdoc/files/LICENSE.html
|
61
59
|
- doc/rdoc/files/README.html
|
62
60
|
- doc/rdoc/files/TODO.html
|
63
61
|
- doc/rdoc/files/lib/merb
|
64
|
-
- doc/rdoc/files/lib/merb_config_rb.html
|
65
62
|
- doc/rdoc/files/lib/merb_rb.html
|
63
|
+
- doc/rdoc/files/lib/merb_tasks_rb.html
|
66
64
|
- doc/rdoc/files/lib/merb/merb_controller_rb.html
|
67
|
-
- doc/rdoc/files/lib/merb/merb_daemon_rb.html
|
68
65
|
- doc/rdoc/files/lib/merb/merb_handler_rb.html
|
69
66
|
- doc/rdoc/files/lib/merb/merb_router_rb.html
|
70
67
|
- doc/rdoc/files/lib/merb/merb_utils_rb.html
|
71
|
-
- doc/rdoc/files/lib/merb/noroutefound_rb.html
|
72
68
|
- test/test_helper.rb
|
73
69
|
- test/unit
|
74
70
|
- test/unit/route_matcher_test.rb
|
75
71
|
- lib/merb
|
76
72
|
- lib/merb.rb
|
77
|
-
- lib/
|
73
|
+
- lib/merb_tasks.rb
|
74
|
+
- lib/tasks
|
78
75
|
- lib/merb/merb_controller.rb
|
79
|
-
- lib/merb/merb_daemon.rb
|
80
76
|
- lib/merb/merb_handler.rb
|
81
77
|
- lib/merb/merb_router.rb
|
82
78
|
- lib/merb/merb_utils.rb
|
83
|
-
- lib/
|
79
|
+
- lib/tasks/db.rake
|
80
|
+
- examples/app_skeleton
|
84
81
|
- examples/sample_app
|
85
|
-
- examples/
|
82
|
+
- examples/app_skeleton/dist
|
83
|
+
- examples/app_skeleton/log
|
84
|
+
- examples/app_skeleton/plugins
|
85
|
+
- examples/app_skeleton/Rakefile
|
86
|
+
- examples/app_skeleton/scripts
|
87
|
+
- examples/app_skeleton/test
|
88
|
+
- examples/app_skeleton/dist/app
|
89
|
+
- examples/app_skeleton/dist/conf
|
90
|
+
- examples/app_skeleton/dist/lib
|
91
|
+
- examples/app_skeleton/dist/plugins
|
92
|
+
- examples/app_skeleton/dist/public
|
93
|
+
- examples/app_skeleton/dist/schema
|
94
|
+
- examples/app_skeleton/dist/app/controllers
|
95
|
+
- examples/app_skeleton/dist/app/models
|
96
|
+
- examples/app_skeleton/dist/app/views
|
97
|
+
- examples/app_skeleton/dist/app/views/layout
|
98
|
+
- examples/app_skeleton/dist/conf/merb_init.rb
|
99
|
+
- examples/app_skeleton/dist/conf/router.rb
|
100
|
+
- examples/app_skeleton/dist/public/files
|
101
|
+
- examples/app_skeleton/dist/public/images
|
102
|
+
- examples/app_skeleton/dist/public/javascripts
|
103
|
+
- examples/app_skeleton/dist/public/stylesheets
|
104
|
+
- examples/app_skeleton/dist/schema/migrations
|
105
|
+
- examples/app_skeleton/scripts/merb_stop
|
106
|
+
- examples/app_skeleton/scripts/new_migration
|
107
|
+
- examples/app_skeleton/test/fixtures
|
108
|
+
- examples/app_skeleton/test/spec
|
109
|
+
- examples/app_skeleton/test/test_helper.rb
|
110
|
+
- examples/app_skeleton/test/unit
|
86
111
|
- examples/sample_app/dist
|
112
|
+
- examples/sample_app/log
|
87
113
|
- examples/sample_app/plugins
|
88
|
-
- examples/sample_app/
|
114
|
+
- examples/sample_app/Rakefile
|
115
|
+
- examples/sample_app/script
|
89
116
|
- examples/sample_app/test
|
90
117
|
- examples/sample_app/dist/app
|
91
118
|
- examples/sample_app/dist/conf
|
92
119
|
- examples/sample_app/dist/lib
|
93
|
-
- examples/sample_app/dist/log
|
94
120
|
- examples/sample_app/dist/plugins
|
95
121
|
- examples/sample_app/dist/public
|
122
|
+
- examples/sample_app/dist/schema
|
96
123
|
- examples/sample_app/dist/app/controllers
|
97
124
|
- examples/sample_app/dist/app/models
|
98
125
|
- examples/sample_app/dist/app/views
|
99
126
|
- examples/sample_app/dist/app/controllers/posts.rb
|
100
127
|
- examples/sample_app/dist/app/controllers/test.rb
|
101
128
|
- examples/sample_app/dist/app/controllers/upload.rb
|
129
|
+
- examples/sample_app/dist/app/models/comment.rb
|
102
130
|
- examples/sample_app/dist/app/models/post.rb
|
103
131
|
- examples/sample_app/dist/app/views/layout
|
104
132
|
- examples/sample_app/dist/app/views/posts
|
@@ -106,7 +134,8 @@ files:
|
|
106
134
|
- examples/sample_app/dist/app/views/upload
|
107
135
|
- examples/sample_app/dist/app/views/layout/application.rhtml
|
108
136
|
- examples/sample_app/dist/app/views/layout/foo.rhtml
|
109
|
-
- examples/sample_app/dist/app/views/
|
137
|
+
- examples/sample_app/dist/app/views/posts/_comments.rhtml
|
138
|
+
- examples/sample_app/dist/app/views/posts/comment.merbjs
|
110
139
|
- examples/sample_app/dist/app/views/posts/list.rhtml
|
111
140
|
- examples/sample_app/dist/app/views/posts/new.rhtml
|
112
141
|
- examples/sample_app/dist/app/views/posts/show.rhtml
|
@@ -117,30 +146,34 @@ files:
|
|
117
146
|
- examples/sample_app/dist/conf/merb_init.rb
|
118
147
|
- examples/sample_app/dist/conf/router.rb
|
119
148
|
- examples/sample_app/dist/public/files
|
149
|
+
- examples/sample_app/dist/public/images
|
150
|
+
- examples/sample_app/dist/public/javascripts
|
151
|
+
- examples/sample_app/dist/public/stylesheets
|
152
|
+
- examples/sample_app/dist/public/images/bg.jpg
|
153
|
+
- examples/sample_app/dist/public/images/book.gif
|
154
|
+
- examples/sample_app/dist/public/images/booksmall.gif
|
155
|
+
- examples/sample_app/dist/public/images/greenright.jpg
|
156
|
+
- examples/sample_app/dist/public/images/louiecon.gif
|
157
|
+
- examples/sample_app/dist/public/images/menu.gif
|
158
|
+
- examples/sample_app/dist/public/images/menuleft.gif
|
159
|
+
- examples/sample_app/dist/public/images/menuright.gif
|
160
|
+
- examples/sample_app/dist/public/images/mountain.jpg
|
161
|
+
- examples/sample_app/dist/public/images/n3.jpg
|
162
|
+
- examples/sample_app/dist/public/images/nautica.jpg
|
163
|
+
- examples/sample_app/dist/public/javascripts/application.js
|
164
|
+
- examples/sample_app/dist/public/javascripts/effects.js
|
165
|
+
- examples/sample_app/dist/public/javascripts/prototype.js
|
166
|
+
- examples/sample_app/dist/public/stylesheets/merb.css
|
167
|
+
- examples/sample_app/dist/schema/migrations
|
168
|
+
- examples/sample_app/dist/schema/schema.rb
|
169
|
+
- examples/sample_app/dist/schema/migrations/001_add_comments_to_posts.rb
|
170
|
+
- examples/sample_app/log/merb.log
|
171
|
+
- examples/sample_app/script/merb_stop
|
172
|
+
- examples/sample_app/script/new_migration
|
120
173
|
- examples/sample_app/test/fixtures
|
121
174
|
- examples/sample_app/test/spec
|
122
175
|
- examples/sample_app/test/test_helper.rb
|
123
176
|
- examples/sample_app/test/unit
|
124
|
-
- examples/skeleton/dist
|
125
|
-
- examples/skeleton/plugins
|
126
|
-
- examples/skeleton/scripts
|
127
|
-
- examples/skeleton/test
|
128
|
-
- examples/skeleton/dist/app
|
129
|
-
- examples/skeleton/dist/conf
|
130
|
-
- examples/skeleton/dist/lib
|
131
|
-
- examples/skeleton/dist/log
|
132
|
-
- examples/skeleton/dist/plugins
|
133
|
-
- examples/skeleton/dist/public
|
134
|
-
- examples/skeleton/dist/app/controllers
|
135
|
-
- examples/skeleton/dist/app/models
|
136
|
-
- examples/skeleton/dist/app/views
|
137
|
-
- examples/skeleton/dist/conf/merb_init.rb
|
138
|
-
- examples/skeleton/dist/conf/router.rb
|
139
|
-
- examples/skeleton/dist/public/files
|
140
|
-
- examples/skeleton/test/fixtures
|
141
|
-
- examples/skeleton/test/spec
|
142
|
-
- examples/skeleton/test/test_helper.rb
|
143
|
-
- examples/skeleton/test/unit
|
144
177
|
test_files: []
|
145
178
|
|
146
179
|
rdoc_options:
|
@@ -1,161 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
-
<!DOCTYPE html
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
-
|
6
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
-
<head>
|
8
|
-
<title>Class: Merb::Config</title>
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
-
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
-
<script type="text/javascript">
|
13
|
-
// <![CDATA[
|
14
|
-
|
15
|
-
function popupCode( url ) {
|
16
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
-
}
|
18
|
-
|
19
|
-
function toggleCode( id ) {
|
20
|
-
if ( document.getElementById )
|
21
|
-
elem = document.getElementById( id );
|
22
|
-
else if ( document.all )
|
23
|
-
elem = eval( "document.all." + id );
|
24
|
-
else
|
25
|
-
return false;
|
26
|
-
|
27
|
-
elemStyle = elem.style;
|
28
|
-
|
29
|
-
if ( elemStyle.display != "block" ) {
|
30
|
-
elemStyle.display = "block"
|
31
|
-
} else {
|
32
|
-
elemStyle.display = "none"
|
33
|
-
}
|
34
|
-
|
35
|
-
return true;
|
36
|
-
}
|
37
|
-
|
38
|
-
// Make codeblocks hidden by default
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
-
|
41
|
-
// ]]>
|
42
|
-
</script>
|
43
|
-
|
44
|
-
</head>
|
45
|
-
<body>
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
<div id="classHeader">
|
50
|
-
<table class="header-table">
|
51
|
-
<tr class="top-aligned-row">
|
52
|
-
<td><strong>Class</strong></td>
|
53
|
-
<td class="class-name-in-header">Merb::Config</td>
|
54
|
-
</tr>
|
55
|
-
<tr class="top-aligned-row">
|
56
|
-
<td><strong>In:</strong></td>
|
57
|
-
<td>
|
58
|
-
<a href="../../files/lib/merb_config_rb.html">
|
59
|
-
lib/merb_config.rb
|
60
|
-
</a>
|
61
|
-
<br />
|
62
|
-
</td>
|
63
|
-
</tr>
|
64
|
-
|
65
|
-
<tr class="top-aligned-row">
|
66
|
-
<td><strong>Parent:</strong></td>
|
67
|
-
<td>
|
68
|
-
<a href="../Object.html">
|
69
|
-
Object
|
70
|
-
</a>
|
71
|
-
</td>
|
72
|
-
</tr>
|
73
|
-
</table>
|
74
|
-
</div>
|
75
|
-
<!-- banner header -->
|
76
|
-
|
77
|
-
<div id="bodyContent">
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
<div id="contextContent">
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
</div>
|
86
|
-
|
87
|
-
<div id="method-list">
|
88
|
-
<h3 class="section-bar">Methods</h3>
|
89
|
-
|
90
|
-
<div class="name-list">
|
91
|
-
<a href="#M000035">setup</a>
|
92
|
-
</div>
|
93
|
-
</div>
|
94
|
-
|
95
|
-
</div>
|
96
|
-
|
97
|
-
|
98
|
-
<!-- if includes -->
|
99
|
-
|
100
|
-
<div id="section">
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
<!-- if method_list -->
|
110
|
-
<div id="methods">
|
111
|
-
<h3 class="section-bar">Public Class methods</h3>
|
112
|
-
|
113
|
-
<div id="method-M000035" class="method-detail">
|
114
|
-
<a name="M000035"></a>
|
115
|
-
|
116
|
-
<div class="method-heading">
|
117
|
-
<a href="#M000035" class="method-signature">
|
118
|
-
<span class="method-name">setup</span><span class="method-args">()</span>
|
119
|
-
</a>
|
120
|
-
</div>
|
121
|
-
|
122
|
-
<div class="method-description">
|
123
|
-
<p><a class="source-toggle" href="#"
|
124
|
-
onclick="toggleCode('M000035-source');return false;">[Source]</a></p>
|
125
|
-
<div class="method-source-code" id="M000035-source">
|
126
|
-
<pre>
|
127
|
-
<span class="ruby-comment cmt"># File lib/merb_config.rb, line 5</span>
|
128
|
-
5: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">setup</span>
|
129
|
-
6: <span class="ruby-identifier">defaults</span> = {
|
130
|
-
7: <span class="ruby-identifier">:host</span> =<span class="ruby-operator">></span> <span class="ruby-value str">"0.0.0.0"</span>,
|
131
|
-
8: <span class="ruby-identifier">:port</span> =<span class="ruby-operator">></span> <span class="ruby-value str">"4000"</span>,
|
132
|
-
9: <span class="ruby-identifier">:allow_reloading</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">true</span>,
|
133
|
-
10: <span class="ruby-identifier">:merb_root</span> =<span class="ruby-operator">></span> <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">pwd</span>
|
134
|
-
11: }
|
135
|
-
12:
|
136
|
-
13: <span class="ruby-keyword kw">begin</span>
|
137
|
-
14: <span class="ruby-identifier">options</span> = <span class="ruby-identifier">defaults</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-constant">YAML</span>.<span class="ruby-identifier">load</span>(<span class="ruby-constant">ERB</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">IO</span>.<span class="ruby-identifier">read</span>(<span class="ruby-node">"#{defaults[:merb_root]}/dist/conf/merb.yml"</span>)).<span class="ruby-identifier">result</span>))
|
138
|
-
15: <span class="ruby-keyword kw">rescue</span>
|
139
|
-
16: <span class="ruby-identifier">options</span> = <span class="ruby-identifier">defaults</span>
|
140
|
-
17: <span class="ruby-keyword kw">end</span>
|
141
|
-
18:
|
142
|
-
19: <span class="ruby-identifier">options</span>
|
143
|
-
20: <span class="ruby-keyword kw">end</span>
|
144
|
-
</pre>
|
145
|
-
</div>
|
146
|
-
</div>
|
147
|
-
</div>
|
148
|
-
|
149
|
-
|
150
|
-
</div>
|
151
|
-
|
152
|
-
|
153
|
-
</div>
|
154
|
-
|
155
|
-
|
156
|
-
<div id="validator-badges">
|
157
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
158
|
-
</div>
|
159
|
-
|
160
|
-
</body>
|
161
|
-
</html>
|
@@ -1,288 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
-
<!DOCTYPE html
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
-
|
6
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
-
<head>
|
8
|
-
<title>Class: Merb::Server</title>
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
-
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
-
<script type="text/javascript">
|
13
|
-
// <![CDATA[
|
14
|
-
|
15
|
-
function popupCode( url ) {
|
16
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
-
}
|
18
|
-
|
19
|
-
function toggleCode( id ) {
|
20
|
-
if ( document.getElementById )
|
21
|
-
elem = document.getElementById( id );
|
22
|
-
else if ( document.all )
|
23
|
-
elem = eval( "document.all." + id );
|
24
|
-
else
|
25
|
-
return false;
|
26
|
-
|
27
|
-
elemStyle = elem.style;
|
28
|
-
|
29
|
-
if ( elemStyle.display != "block" ) {
|
30
|
-
elemStyle.display = "block"
|
31
|
-
} else {
|
32
|
-
elemStyle.display = "none"
|
33
|
-
}
|
34
|
-
|
35
|
-
return true;
|
36
|
-
}
|
37
|
-
|
38
|
-
// Make codeblocks hidden by default
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
-
|
41
|
-
// ]]>
|
42
|
-
</script>
|
43
|
-
|
44
|
-
</head>
|
45
|
-
<body>
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
<div id="classHeader">
|
50
|
-
<table class="header-table">
|
51
|
-
<tr class="top-aligned-row">
|
52
|
-
<td><strong>Class</strong></td>
|
53
|
-
<td class="class-name-in-header">Merb::Server</td>
|
54
|
-
</tr>
|
55
|
-
<tr class="top-aligned-row">
|
56
|
-
<td><strong>In:</strong></td>
|
57
|
-
<td>
|
58
|
-
<a href="../../files/lib/merb/merb_daemon_rb.html">
|
59
|
-
lib/merb/merb_daemon.rb
|
60
|
-
</a>
|
61
|
-
<br />
|
62
|
-
</td>
|
63
|
-
</tr>
|
64
|
-
|
65
|
-
<tr class="top-aligned-row">
|
66
|
-
<td><strong>Parent:</strong></td>
|
67
|
-
<td>
|
68
|
-
<a href="../Object.html">
|
69
|
-
Object
|
70
|
-
</a>
|
71
|
-
</td>
|
72
|
-
</tr>
|
73
|
-
</table>
|
74
|
-
</div>
|
75
|
-
<!-- banner header -->
|
76
|
-
|
77
|
-
<div id="bodyContent">
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
<div id="contextContent">
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
</div>
|
86
|
-
|
87
|
-
<div id="method-list">
|
88
|
-
<h3 class="section-bar">Methods</h3>
|
89
|
-
|
90
|
-
<div class="name-list">
|
91
|
-
<a href="#M000052">config</a>
|
92
|
-
<a href="#M000051">exit</a>
|
93
|
-
<a href="#M000049">merb_config</a>
|
94
|
-
<a href="#M000050">run</a>
|
95
|
-
</div>
|
96
|
-
</div>
|
97
|
-
|
98
|
-
</div>
|
99
|
-
|
100
|
-
|
101
|
-
<!-- if includes -->
|
102
|
-
|
103
|
-
<div id="section">
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
<!-- if method_list -->
|
113
|
-
<div id="methods">
|
114
|
-
<h3 class="section-bar">Public Class methods</h3>
|
115
|
-
|
116
|
-
<div id="method-M000052" class="method-detail">
|
117
|
-
<a name="M000052"></a>
|
118
|
-
|
119
|
-
<div class="method-heading">
|
120
|
-
<a href="#M000052" class="method-signature">
|
121
|
-
<span class="method-name">config</span><span class="method-args">()</span>
|
122
|
-
</a>
|
123
|
-
</div>
|
124
|
-
|
125
|
-
<div class="method-description">
|
126
|
-
<p><a class="source-toggle" href="#"
|
127
|
-
onclick="toggleCode('M000052-source');return false;">[Source]</a></p>
|
128
|
-
<div class="method-source-code" id="M000052-source">
|
129
|
-
<pre>
|
130
|
-
<span class="ruby-comment cmt"># File lib/merb/merb_daemon.rb, line 86</span>
|
131
|
-
86: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">config</span>
|
132
|
-
87: <span class="ruby-ivar">@@merb_opts</span>
|
133
|
-
88: <span class="ruby-keyword kw">end</span>
|
134
|
-
</pre>
|
135
|
-
</div>
|
136
|
-
</div>
|
137
|
-
</div>
|
138
|
-
|
139
|
-
<div id="method-M000049" class="method-detail">
|
140
|
-
<a name="M000049"></a>
|
141
|
-
|
142
|
-
<div class="method-heading">
|
143
|
-
<a href="#M000049" class="method-signature">
|
144
|
-
<span class="method-name">merb_config</span><span class="method-args">()</span>
|
145
|
-
</a>
|
146
|
-
</div>
|
147
|
-
|
148
|
-
<div class="method-description">
|
149
|
-
<p><a class="source-toggle" href="#"
|
150
|
-
onclick="toggleCode('M000049-source');return false;">[Source]</a></p>
|
151
|
-
<div class="method-source-code" id="M000049-source">
|
152
|
-
<pre>
|
153
|
-
<span class="ruby-comment cmt"># File lib/merb/merb_daemon.rb, line 12</span>
|
154
|
-
12: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">merb_config</span>
|
155
|
-
13: <span class="ruby-identifier">options</span> = <span class="ruby-constant">Merb</span><span class="ruby-operator">::</span><span class="ruby-constant">Config</span>.<span class="ruby-identifier">setup</span>
|
156
|
-
14:
|
157
|
-
15: <span class="ruby-identifier">opts</span> = <span class="ruby-constant">OptionParser</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">opts</span><span class="ruby-operator">|</span>
|
158
|
-
16: <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">"-c"</span>, <span class="ruby-value str">"--config [String]"</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">config</span><span class="ruby-operator">|</span>
|
159
|
-
17: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:config</span>] = <span class="ruby-identifier">config</span>
|
160
|
-
18: <span class="ruby-keyword kw">end</span>
|
161
|
-
19:
|
162
|
-
20: <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">"-p"</span>, <span class="ruby-value str">"--port [Integer]"</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">port</span><span class="ruby-operator">|</span>
|
163
|
-
21: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:port</span>] = <span class="ruby-identifier">port</span>
|
164
|
-
22: <span class="ruby-keyword kw">end</span>
|
165
|
-
23:
|
166
|
-
24: <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">"-n"</span>, <span class="ruby-value str">"--num-procs [Integer]"</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">numprocs</span><span class="ruby-operator">|</span>
|
167
|
-
25: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:numprocs</span>] = <span class="ruby-identifier">numprocs</span>
|
168
|
-
26: <span class="ruby-keyword kw">end</span>
|
169
|
-
27:
|
170
|
-
28: <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">"-h"</span>, <span class="ruby-value str">"--host [String]"</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">host</span><span class="ruby-operator">|</span>
|
171
|
-
29: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:host</span>] = <span class="ruby-identifier">host</span>
|
172
|
-
30: <span class="ruby-keyword kw">end</span>
|
173
|
-
31:
|
174
|
-
32: <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">"-m"</span>, <span class="ruby-value str">"--merb-root [String]"</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">merb_root</span><span class="ruby-operator">|</span>
|
175
|
-
33: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:merb_root</span>] = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">merb_root</span>)
|
176
|
-
34: <span class="ruby-keyword kw">end</span>
|
177
|
-
35:
|
178
|
-
36: <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">"-i"</span>, <span class="ruby-value str">"--irb-console [String]"</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">console</span><span class="ruby-operator">|</span>
|
179
|
-
37: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:console</span>] = <span class="ruby-keyword kw">true</span>
|
180
|
-
38: <span class="ruby-keyword kw">end</span>
|
181
|
-
39: <span class="ruby-keyword kw">end</span>
|
182
|
-
40:
|
183
|
-
41: <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">parse!</span>(<span class="ruby-ivar">@@merb_raw_opts</span>)
|
184
|
-
42:
|
185
|
-
43:
|
186
|
-
44: <span class="ruby-ivar">@@merb_opts</span> = <span class="ruby-identifier">options</span>
|
187
|
-
45: <span class="ruby-identifier">puts</span> <span class="ruby-value str">%{Merb started with these options:}</span>
|
188
|
-
46: <span class="ruby-identifier">puts</span> <span class="ruby-ivar">@@merb_opts</span>.<span class="ruby-identifier">to_yaml</span>; <span class="ruby-identifier">puts</span>
|
189
|
-
47: <span class="ruby-keyword kw">end</span>
|
190
|
-
</pre>
|
191
|
-
</div>
|
192
|
-
</div>
|
193
|
-
</div>
|
194
|
-
|
195
|
-
<div id="method-M000050" class="method-detail">
|
196
|
-
<a name="M000050"></a>
|
197
|
-
|
198
|
-
<div class="method-heading">
|
199
|
-
<a href="#M000050" class="method-signature">
|
200
|
-
<span class="method-name">run</span><span class="method-args">()</span>
|
201
|
-
</a>
|
202
|
-
</div>
|
203
|
-
|
204
|
-
<div class="method-description">
|
205
|
-
<p><a class="source-toggle" href="#"
|
206
|
-
onclick="toggleCode('M000050-source');return false;">[Source]</a></p>
|
207
|
-
<div class="method-source-code" id="M000050-source">
|
208
|
-
<pre>
|
209
|
-
<span class="ruby-comment cmt"># File lib/merb/merb_daemon.rb, line 49</span>
|
210
|
-
49: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">run</span>
|
211
|
-
50:
|
212
|
-
51: <span class="ruby-identifier">options</span> = {
|
213
|
-
52: <span class="ruby-identifier">:dir</span> =<span class="ruby-operator">></span> <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">pwd</span> <span class="ruby-operator">+</span> <span class="ruby-value str">'/log/'</span>,
|
214
|
-
53: <span class="ruby-identifier">:dir_mode</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">:normal</span>
|
215
|
-
54: }
|
216
|
-
55:
|
217
|
-
56: <span class="ruby-ivar">@@merb_raw_opts</span> = <span class="ruby-constant">ARGV</span>
|
218
|
-
57: <span class="ruby-identifier">merb_config</span>
|
219
|
-
58:
|
220
|
-
59: <span class="ruby-ivar">@@merb_opts</span>[<span class="ruby-identifier">:dist_root</span>] = <span class="ruby-ivar">@@merb_opts</span>[<span class="ruby-identifier">:merb_root</span>]<span class="ruby-operator">+</span><span class="ruby-value str">'/dist'</span>
|
221
|
-
60:
|
222
|
-
61: <span class="ruby-identifier">$LOAD_PATH</span>.<span class="ruby-identifier">unshift</span>( <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@@merb_opts</span>[<span class="ruby-identifier">:merb_root</span>] , <span class="ruby-value str">'/dist/app/controllers'</span>) )
|
223
|
-
62: <span class="ruby-identifier">$LOAD_PATH</span>.<span class="ruby-identifier">unshift</span>( <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@@merb_opts</span>[<span class="ruby-identifier">:merb_root</span>] , <span class="ruby-value str">'/dist/lib'</span>) )
|
224
|
-
63: <span class="ruby-identifier">require</span> <span class="ruby-ivar">@@merb_opts</span>[<span class="ruby-identifier">:merb_root</span>]<span class="ruby-operator">+</span><span class="ruby-value str">'/dist/conf/router.rb'</span>
|
225
|
-
64: <span class="ruby-identifier">require</span> <span class="ruby-ivar">@@merb_opts</span>[<span class="ruby-identifier">:merb_root</span>]<span class="ruby-operator">+</span><span class="ruby-value str">'/dist/conf/merb_init.rb'</span>
|
226
|
-
65:
|
227
|
-
66: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@@merb_opts</span>[<span class="ruby-identifier">:console</span>]
|
228
|
-
67: <span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">clear</span> <span class="ruby-comment cmt"># Avoid passing args to IRB </span>
|
229
|
-
68: <span class="ruby-identifier">require</span> <span class="ruby-value str">'irb'</span>
|
230
|
-
69: <span class="ruby-identifier">require</span> <span class="ruby-value str">'irb/completion'</span>
|
231
|
-
70: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">exit</span>
|
232
|
-
71: <span class="ruby-identifier">exit!</span>
|
233
|
-
72: <span class="ruby-keyword kw">end</span>
|
234
|
-
73: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span> <span class="ruby-value str">".irbrc"</span>
|
235
|
-
74: <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'IRBRC'</span>] = <span class="ruby-value str">".irbrc"</span>
|
236
|
-
75: <span class="ruby-keyword kw">end</span>
|
237
|
-
76: <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">start</span>
|
238
|
-
77: <span class="ruby-keyword kw">end</span>
|
239
|
-
78:
|
240
|
-
79: <span class="ruby-identifier">h</span> = <span class="ruby-constant">Mongrel</span><span class="ruby-operator">::</span><span class="ruby-constant">HttpServer</span>.<span class="ruby-identifier">new</span>((<span class="ruby-ivar">@@merb_opts</span>[<span class="ruby-identifier">:host</span>]<span class="ruby-operator">||</span><span class="ruby-value str">"0.0.0.0"</span>), (<span class="ruby-ivar">@@merb_opts</span>[<span class="ruby-identifier">:port</span>]<span class="ruby-operator">||</span><span class="ruby-value">4000</span>))<span class="ruby-comment cmt">#, (@@merb_opts[:numprocs]||40))</span>
|
241
|
-
80: <span class="ruby-identifier">h</span>.<span class="ruby-identifier">register</span>(<span class="ruby-value str">"/"</span>, <span class="ruby-constant">MerbHandler</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@@merb_opts</span>[<span class="ruby-identifier">:dist_root</span>]<span class="ruby-operator">+</span><span class="ruby-value str">'/public'</span>))
|
242
|
-
81: <span class="ruby-identifier">h</span>.<span class="ruby-identifier">register</span>(<span class="ruby-value str">"/favicon.ico"</span>, <span class="ruby-constant">Mongrel</span><span class="ruby-operator">::</span><span class="ruby-constant">Error404Handler</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">""</span>))
|
243
|
-
82: <span class="ruby-identifier">h</span>.<span class="ruby-identifier">run</span>.<span class="ruby-identifier">join</span>
|
244
|
-
83:
|
245
|
-
84: <span class="ruby-keyword kw">end</span>
|
246
|
-
</pre>
|
247
|
-
</div>
|
248
|
-
</div>
|
249
|
-
</div>
|
250
|
-
|
251
|
-
<h3 class="section-bar">Public Instance methods</h3>
|
252
|
-
|
253
|
-
<div id="method-M000051" class="method-detail">
|
254
|
-
<a name="M000051"></a>
|
255
|
-
|
256
|
-
<div class="method-heading">
|
257
|
-
<a href="#M000051" class="method-signature">
|
258
|
-
<span class="method-name">exit</span><span class="method-args">()</span>
|
259
|
-
</a>
|
260
|
-
</div>
|
261
|
-
|
262
|
-
<div class="method-description">
|
263
|
-
<p><a class="source-toggle" href="#"
|
264
|
-
onclick="toggleCode('M000051-source');return false;">[Source]</a></p>
|
265
|
-
<div class="method-source-code" id="M000051-source">
|
266
|
-
<pre>
|
267
|
-
<span class="ruby-comment cmt"># File lib/merb/merb_daemon.rb, line 70</span>
|
268
|
-
70: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">exit</span>
|
269
|
-
71: <span class="ruby-identifier">exit!</span>
|
270
|
-
72: <span class="ruby-keyword kw">end</span>
|
271
|
-
</pre>
|
272
|
-
</div>
|
273
|
-
</div>
|
274
|
-
</div>
|
275
|
-
|
276
|
-
|
277
|
-
</div>
|
278
|
-
|
279
|
-
|
280
|
-
</div>
|
281
|
-
|
282
|
-
|
283
|
-
<div id="validator-badges">
|
284
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
285
|
-
</div>
|
286
|
-
|
287
|
-
</body>
|
288
|
-
</html>
|