milk 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +1 -1
- data/lib/milk.rb +13 -0
- data/lib/milk/application.rb +14 -0
- data/lib/milk/component.rb +67 -40
- data/lib/milk/field.rb +46 -2
- data/lib/milk/fields/component.haml +8 -0
- data/lib/milk/fields/component_array.haml +3 -0
- data/lib/milk/fields/component_view.haml +2 -0
- data/lib/milk/fields/image_chooser.haml +7 -0
- data/lib/milk/fields/image_chooser.rb +22 -0
- data/lib/milk/fields/markdown_field.haml +1 -0
- data/lib/milk/fields/page_chooser.haml +3 -0
- data/lib/milk/fields/page_chooser.rb +13 -0
- data/lib/milk/fields/sprite_chooser.haml +6 -0
- data/lib/milk/fields/sprite_chooser.rb +15 -0
- data/lib/milk/fields/text_field.haml +1 -0
- data/lib/milk/fields/xhtml.haml +253 -2
- data/lib/milk/page.rb +56 -14
- metadata +11 -174
- data/doc/classes/Milk.html +0 -198
- data/doc/classes/Milk.src/M000005.html +0 -17
- data/doc/classes/Milk/Application.html +0 -209
- data/doc/classes/Milk/Application.src/M000007.html +0 -69
- data/doc/classes/Milk/Application.src/M000008.html +0 -38
- data/doc/classes/Milk/Component.html +0 -397
- data/doc/classes/Milk/Component.src/M000014.html +0 -19
- data/doc/classes/Milk/Component.src/M000015.html +0 -16
- data/doc/classes/Milk/Component.src/M000016.html +0 -15
- data/doc/classes/Milk/Component.src/M000017.html +0 -15
- data/doc/classes/Milk/Component.src/M000018.html +0 -15
- data/doc/classes/Milk/Component.src/M000019.html +0 -15
- data/doc/classes/Milk/Component.src/M000020.html +0 -15
- data/doc/classes/Milk/Component.src/M000021.html +0 -15
- data/doc/classes/Milk/Component.src/M000022.html +0 -18
- data/doc/classes/Milk/Component.src/M000023.html +0 -21
- data/doc/classes/Milk/Component.src/M000024.html +0 -15
- data/doc/classes/Milk/Component.src/M000025.html +0 -22
- data/doc/classes/Milk/ExternalCompilerError.html +0 -117
- data/doc/classes/Milk/Field.html +0 -114
- data/doc/classes/Milk/Fields.html +0 -173
- data/doc/classes/Milk/Fields/ComponentArray.html +0 -114
- data/doc/classes/Milk/Fields/ImageChooser.html +0 -114
- data/doc/classes/Milk/Fields/MarkdownField.html +0 -114
- data/doc/classes/Milk/Fields/PageChooser.html +0 -114
- data/doc/classes/Milk/Fields/SpriteChooser.html +0 -114
- data/doc/classes/Milk/Fields/TextField.html +0 -114
- data/doc/classes/Milk/Haxe.html +0 -208
- data/doc/classes/Milk/Haxe.src/M000005.html +0 -40
- data/doc/classes/Milk/Haxe.src/M000006.html +0 -15
- data/doc/classes/Milk/Page.html +0 -243
- data/doc/classes/Milk/Page.src/M000009.html +0 -17
- data/doc/classes/Milk/Page.src/M000010.html +0 -17
- data/doc/classes/Milk/Page.src/M000011.html +0 -18
- data/doc/classes/Milk/Page.src/M000012.html +0 -20
- data/doc/classes/Milk/Page.src/M000013.html +0 -21
- data/doc/classes/Milk/PageNotFoundError.html +0 -110
- data/doc/classes/Object.html +0 -237
- data/doc/classes/Object.src/M000001.html +0 -13
- data/doc/classes/Object.src/M000002.html +0 -13
- data/doc/classes/Object.src/M000003.html +0 -15
- data/doc/classes/Object.src/M000004.html +0 -15
- data/doc/created.rid +0 -1
- data/doc/files/INSTALL.html +0 -106
- data/doc/files/LICENSE.html +0 -126
- data/doc/files/README.html +0 -100
- data/doc/files/Rakefile.html +0 -121
- data/doc/files/bin/milk.html +0 -100
- data/doc/files/doc/classes/Milk/Application_html.html +0 -302
- data/doc/files/doc/classes/Milk/Application_src/M000007_html.html +0 -173
- data/doc/files/doc/classes/Milk/Application_src/M000008_html.html +0 -142
- data/doc/files/doc/classes/Milk/Component_html.html +0 -477
- data/doc/files/doc/classes/Milk/Component_src/M000014_html.html +0 -123
- data/doc/files/doc/classes/Milk/Component_src/M000015_html.html +0 -120
- data/doc/files/doc/classes/Milk/Component_src/M000016_html.html +0 -119
- data/doc/files/doc/classes/Milk/Component_src/M000017_html.html +0 -119
- data/doc/files/doc/classes/Milk/Component_src/M000018_html.html +0 -119
- data/doc/files/doc/classes/Milk/Component_src/M000019_html.html +0 -119
- data/doc/files/doc/classes/Milk/Component_src/M000020_html.html +0 -119
- data/doc/files/doc/classes/Milk/Component_src/M000021_html.html +0 -119
- data/doc/files/doc/classes/Milk/Component_src/M000022_html.html +0 -122
- data/doc/files/doc/classes/Milk/Component_src/M000023_html.html +0 -125
- data/doc/files/doc/classes/Milk/Component_src/M000024_html.html +0 -119
- data/doc/files/doc/classes/Milk/Component_src/M000025_html.html +0 -126
- data/doc/files/doc/classes/Milk/ExternalCompilerError_html.html +0 -214
- data/doc/files/doc/classes/Milk/Field_html.html +0 -209
- data/doc/files/doc/classes/Milk/Fields/ComponentArray_html.html +0 -209
- data/doc/files/doc/classes/Milk/Fields/ImageChooser_html.html +0 -209
- data/doc/files/doc/classes/Milk/Fields/MarkdownField_html.html +0 -209
- data/doc/files/doc/classes/Milk/Fields/PageChooser_html.html +0 -209
- data/doc/files/doc/classes/Milk/Fields/SpriteChooser_html.html +0 -209
- data/doc/files/doc/classes/Milk/Fields/TextField_html.html +0 -209
- data/doc/files/doc/classes/Milk/Fields_html.html +0 -264
- data/doc/files/doc/classes/Milk/Haxe_html.html +0 -298
- data/doc/files/doc/classes/Milk/Haxe_src/M000005_html.html +0 -144
- data/doc/files/doc/classes/Milk/Haxe_src/M000006_html.html +0 -119
- data/doc/files/doc/classes/Milk/PageNotFoundError_html.html +0 -205
- data/doc/files/doc/classes/Milk/Page_html.html +0 -330
- data/doc/files/doc/classes/Milk/Page_src/M000009_html.html +0 -121
- data/doc/files/doc/classes/Milk/Page_src/M000010_html.html +0 -121
- data/doc/files/doc/classes/Milk/Page_src/M000011_html.html +0 -122
- data/doc/files/doc/classes/Milk/Page_src/M000012_html.html +0 -124
- data/doc/files/doc/classes/Milk/Page_src/M000013_html.html +0 -125
- data/doc/files/doc/classes/Milk_html.html +0 -321
- data/doc/files/doc/classes/Object_html.html +0 -334
- data/doc/files/doc/classes/Object_src/M000001_html.html +0 -117
- data/doc/files/doc/classes/Object_src/M000002_html.html +0 -117
- data/doc/files/doc/classes/Object_src/M000003_html.html +0 -119
- data/doc/files/doc/classes/Object_src/M000004_html.html +0 -119
- data/doc/files/doc/created_rid.html +0 -97
- data/doc/files/doc/files/INSTALL_html.html +0 -206
- data/doc/files/doc/files/LICENSE_html.html +0 -226
- data/doc/files/doc/files/README_html.html +0 -201
- data/doc/files/doc/files/Rakefile_html.html +0 -221
- data/doc/files/doc/files/bin/milk_html.html +0 -198
- data/doc/files/doc/files/lib/milk/application_rb_html.html +0 -188
- data/doc/files/doc/files/lib/milk/component_rb_html.html +0 -188
- data/doc/files/doc/files/lib/milk/field_rb_html.html +0 -188
- data/doc/files/doc/files/lib/milk/fields/component_array_rb_html.html +0 -188
- data/doc/files/doc/files/lib/milk/fields/image_chooser_rb_html.html +0 -188
- data/doc/files/doc/files/lib/milk/fields/markdown_field_rb_html.html +0 -188
- data/doc/files/doc/files/lib/milk/fields/page_chooser_rb_html.html +0 -188
- data/doc/files/doc/files/lib/milk/fields/sprite_chooser_rb_html.html +0 -188
- data/doc/files/doc/files/lib/milk/fields/text_field_rb_html.html +0 -188
- data/doc/files/doc/files/lib/milk/fields/xhtml_haml_html.html +0 -211
- data/doc/files/doc/files/lib/milk/haxe_rb_html.html +0 -188
- data/doc/files/doc/files/lib/milk/page_rb_html.html +0 -188
- data/doc/files/doc/files/lib/milk/tasks_rb_html.html +0 -202
- data/doc/files/doc/files/lib/milk/templates/bzrignore_html.html +0 -197
- data/doc/files/doc/files/lib/milk/templates/rackup_html.html +0 -217
- data/doc/files/doc/files/lib/milk/templates/rakefile_html.html +0 -198
- data/doc/files/doc/files/lib/milk/templates/restart_html.html +0 -197
- data/doc/files/doc/files/lib/milk_rb_html.html +0 -197
- data/doc/files/doc/fr_class_index_html.html +0 -160
- data/doc/files/doc/fr_file_index_html.html +0 -174
- data/doc/files/doc/fr_method_index_html.html +0 -178
- data/doc/files/doc/index_html.html +0 -128
- data/doc/files/doc/rdoc-style_css.html +0 -665
- data/doc/files/lib/milk/application_rb.html +0 -90
- data/doc/files/lib/milk/component_rb.html +0 -90
- data/doc/files/lib/milk/field_rb.html +0 -90
- data/doc/files/lib/milk/fields/component_array_rb.html +0 -90
- data/doc/files/lib/milk/fields/image_chooser_rb.html +0 -90
- data/doc/files/lib/milk/fields/markdown_field_rb.html +0 -90
- data/doc/files/lib/milk/fields/page_chooser_rb.html +0 -90
- data/doc/files/lib/milk/fields/sprite_chooser_rb.html +0 -90
- data/doc/files/lib/milk/fields/text_field_rb.html +0 -90
- data/doc/files/lib/milk/fields/xhtml_haml.html +0 -107
- data/doc/files/lib/milk/haxe_rb.html +0 -90
- data/doc/files/lib/milk/page_rb.html +0 -90
- data/doc/files/lib/milk/tasks_rb.html +0 -104
- data/doc/files/lib/milk/templates/bzrignore.html +0 -97
- data/doc/files/lib/milk/templates/rackup.html +0 -119
- data/doc/files/lib/milk/templates/rakefile.html +0 -98
- data/doc/files/lib/milk/templates/restart.html +0 -97
- data/doc/files/lib/milk_rb.html +0 -97
- data/doc/fr_class_index.html +0 -27
- data/doc/fr_file_index.html +0 -169
- data/doc/fr_method_index.html +0 -33
- data/doc/index.html +0 -21
- data/doc/rdoc-style.css +0 -299
@@ -1,17 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
2
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
3
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
-
<head>
|
5
|
-
<title>get_milk_root (Milk)</title>
|
6
|
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
7
|
-
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
8
|
-
</head>
|
9
|
-
<body class="standalone-code">
|
10
|
-
<pre><span class="ruby-comment cmt"># File lib/milk.rb, line 14</span>
|
11
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">get_milk_root</span>
|
12
|
-
<span class="ruby-identifier">c</span> = <span class="ruby-identifier">caller</span>(<span class="ruby-value">1</span>).<span class="ruby-identifier">collect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span> <span class="ruby-identifier">line</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">':'</span>).<span class="ruby-identifier">first</span> }
|
13
|
-
<span class="ruby-identifier">c</span> = <span class="ruby-identifier">c</span>.<span class="ruby-identifier">select</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span> <span class="ruby-identifier">line</span> <span class="ruby-operator">!~</span> <span class="ruby-regexp re">/\/gems\//</span> }
|
14
|
-
<span class="ruby-constant">File</span>.<span class="ruby-identifier">absolute_path</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-identifier">c</span>.<span class="ruby-identifier">first</span>))
|
15
|
-
<span class="ruby-keyword kw">end</span></pre>
|
16
|
-
</body>
|
17
|
-
</html>
|
@@ -1,209 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
2
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
3
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
-
<head>
|
5
|
-
<title>Class: Milk::Application [RDoc Documentation]</title>
|
6
|
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
7
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
8
|
-
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
9
|
-
<script type="text/javascript">
|
10
|
-
// <![CDATA[
|
11
|
-
|
12
|
-
function popupCode( url ) {
|
13
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
14
|
-
}
|
15
|
-
|
16
|
-
function toggleCode( id ) {
|
17
|
-
if ( document.getElementById )
|
18
|
-
elem = document.getElementById( id );
|
19
|
-
else if ( document.all )
|
20
|
-
elem = eval( "document.all." + id );
|
21
|
-
else
|
22
|
-
return false;
|
23
|
-
|
24
|
-
elemStyle = elem.style;
|
25
|
-
|
26
|
-
if ( elemStyle.display != "block" ) {
|
27
|
-
elemStyle.display = "block"
|
28
|
-
} else {
|
29
|
-
elemStyle.display = "none"
|
30
|
-
}
|
31
|
-
|
32
|
-
return true;
|
33
|
-
}
|
34
|
-
|
35
|
-
// Make codeblocks hidden by default
|
36
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }<\/style>" )
|
37
|
-
|
38
|
-
// ]]>
|
39
|
-
</script>
|
40
|
-
|
41
|
-
</head>
|
42
|
-
<body>
|
43
|
-
|
44
|
-
|
45
|
-
<div id="classHeader">
|
46
|
-
<table class="header-table">
|
47
|
-
<tr class="top-aligned-row">
|
48
|
-
<td><strong>Class</strong></td>
|
49
|
-
<td class="class-name-in-header">Milk::Application</td>
|
50
|
-
</tr>
|
51
|
-
<tr class="top-aligned-row">
|
52
|
-
<td><strong>In:</strong></td>
|
53
|
-
<td>
|
54
|
-
|
55
|
-
|
56
|
-
<a href="../../files/lib/milk/application_rb.html">
|
57
|
-
|
58
|
-
lib/milk/application.rb
|
59
|
-
|
60
|
-
</a>
|
61
|
-
|
62
|
-
|
63
|
-
<br />
|
64
|
-
|
65
|
-
</td>
|
66
|
-
</tr>
|
67
|
-
|
68
|
-
|
69
|
-
<tr class="top-aligned-row">
|
70
|
-
<td><strong>Parent:</strong></td>
|
71
|
-
<td>
|
72
|
-
|
73
|
-
<a href="../Object.html">
|
74
|
-
|
75
|
-
Object
|
76
|
-
|
77
|
-
</a>
|
78
|
-
|
79
|
-
</td>
|
80
|
-
</tr>
|
81
|
-
|
82
|
-
</table>
|
83
|
-
</div>
|
84
|
-
<!-- banner header -->
|
85
|
-
|
86
|
-
<div id="bodyContent">
|
87
|
-
|
88
|
-
<div id="contextContent">
|
89
|
-
|
90
|
-
</div>
|
91
|
-
|
92
|
-
|
93
|
-
<div id="method-list">
|
94
|
-
<h3 class="section-bar">Methods</h3>
|
95
|
-
|
96
|
-
<div class="name-list">
|
97
|
-
|
98
|
-
<a href="#M000008">call</a>
|
99
|
-
|
100
|
-
<a href="#M000007">route</a>
|
101
|
-
|
102
|
-
</div>
|
103
|
-
</div>
|
104
|
-
|
105
|
-
</div>
|
106
|
-
|
107
|
-
<!-- if includes -->
|
108
|
-
|
109
|
-
<div id="section">
|
110
|
-
|
111
|
-
<div id="constants-list">
|
112
|
-
<h3 class="section-bar">Constants</h3>
|
113
|
-
|
114
|
-
<div class="name-list">
|
115
|
-
<table summary="Constants">
|
116
|
-
|
117
|
-
<tr class="top-aligned-row context-row">
|
118
|
-
<td class="context-item-name">PAGE_PATH_REGEX</td>
|
119
|
-
<td>=</td>
|
120
|
-
<td class="context-item-value">/^\/([A-Z][a-zA-Z]+(\/[A-Z][a-zA-Z]+)*)+\/*$/</td>
|
121
|
-
|
122
|
-
</tr>
|
123
|
-
|
124
|
-
<tr class="top-aligned-row context-row">
|
125
|
-
<td class="context-item-name">EDIT_PATH_REGEX</td>
|
126
|
-
<td>=</td>
|
127
|
-
<td class="context-item-value">/^\/([A-Z][a-zA-Z]+(\/[A-Z][a-zA-Z]+)*)+\/edit\/*$/</td>
|
128
|
-
|
129
|
-
</tr>
|
130
|
-
|
131
|
-
<tr class="top-aligned-row context-row">
|
132
|
-
<td class="context-item-name">HAXE_PATH_REGEX</td>
|
133
|
-
<td>=</td>
|
134
|
-
<td class="context-item-value">/^\/(.*).hx$/</td>
|
135
|
-
|
136
|
-
</tr>
|
137
|
-
|
138
|
-
</table>
|
139
|
-
</div>
|
140
|
-
</div>
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
<!-- if method_list -->
|
146
|
-
|
147
|
-
<div id="methods">
|
148
|
-
|
149
|
-
<h3 class="section-bar">Public Instance methods</h3>
|
150
|
-
|
151
|
-
|
152
|
-
<div id="method-M000008" class="method-detail">
|
153
|
-
<a name="M000008"></a>
|
154
|
-
|
155
|
-
<div class="method-heading">
|
156
|
-
|
157
|
-
<a href="Application.src/M000008.html" target="Code" class="method-signature"
|
158
|
-
onclick="popupCode('Application.src/M000008.html');return false;">
|
159
|
-
|
160
|
-
<span class="method-name">call</span><span class="method-args">(env)</span>
|
161
|
-
|
162
|
-
</a>
|
163
|
-
|
164
|
-
</div>
|
165
|
-
|
166
|
-
<div class="method-description">
|
167
|
-
|
168
|
-
<p>
|
169
|
-
Rack call interface
|
170
|
-
</p>
|
171
|
-
|
172
|
-
</div>
|
173
|
-
</div>
|
174
|
-
|
175
|
-
|
176
|
-
<div id="method-M000007" class="method-detail">
|
177
|
-
<a name="M000007"></a>
|
178
|
-
|
179
|
-
<div class="method-heading">
|
180
|
-
|
181
|
-
<a href="Application.src/M000007.html" target="Code" class="method-signature"
|
182
|
-
onclick="popupCode('Application.src/M000007.html');return false;">
|
183
|
-
|
184
|
-
<span class="method-name">route</span><span class="method-args">(req)</span>
|
185
|
-
|
186
|
-
</a>
|
187
|
-
|
188
|
-
</div>
|
189
|
-
|
190
|
-
<div class="method-description">
|
191
|
-
|
192
|
-
</div>
|
193
|
-
</div>
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
</div>
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
</div>
|
203
|
-
|
204
|
-
<div id="validator-badges">
|
205
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
206
|
-
</div>
|
207
|
-
|
208
|
-
</body>
|
209
|
-
</html>
|
@@ -1,69 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
2
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
3
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
-
<head>
|
5
|
-
<title>route (Milk::Application)</title>
|
6
|
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
7
|
-
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
8
|
-
</head>
|
9
|
-
<body class="standalone-code">
|
10
|
-
<pre><span class="ruby-comment cmt"># File lib/milk/application.rb, line 8</span>
|
11
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">route</span>(<span class="ruby-identifier">req</span>)
|
12
|
-
<span class="ruby-identifier">path</span> = <span class="ruby-identifier">req</span>.<span class="ruby-identifier">path_info</span>
|
13
|
-
|
14
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">path</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'/'</span>
|
15
|
-
<span class="ruby-comment cmt"># Special case for root</span>
|
16
|
-
<span class="ruby-identifier">path</span> = <span class="ruby-value str">'/Home'</span>
|
17
|
-
<span class="ruby-keyword kw">end</span>
|
18
|
-
|
19
|
-
<span class="ruby-comment cmt"># Fallback to match everything</span>
|
20
|
-
<span class="ruby-identifier">regex</span> = <span class="ruby-regexp re">/(.*)/</span>
|
21
|
-
|
22
|
-
<span class="ruby-comment cmt"># Route the request to the right callback</span>
|
23
|
-
<span class="ruby-identifier">action</span> = <span class="ruby-keyword kw">case</span>
|
24
|
-
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">req</span>.<span class="ruby-identifier">get?</span>
|
25
|
-
<span class="ruby-keyword kw">case</span>
|
26
|
-
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">path</span> <span class="ruby-operator">=~</span> <span class="ruby-constant">HAXE_PATH_REGEX</span>
|
27
|
-
<span class="ruby-identifier">regex</span> = <span class="ruby-constant">HAXE_PATH_REGEX</span>
|
28
|
-
<span class="ruby-identifier">:haxe</span>
|
29
|
-
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">path</span> <span class="ruby-operator">=~</span> <span class="ruby-constant">PAGE_PATH_REGEX</span>
|
30
|
-
<span class="ruby-identifier">regex</span> = <span class="ruby-constant">PAGE_PATH_REGEX</span>
|
31
|
-
<span class="ruby-identifier">:view</span>
|
32
|
-
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">path</span> <span class="ruby-operator">=~</span> <span class="ruby-constant">EDIT_PATH_REGEX</span>
|
33
|
-
<span class="ruby-identifier">regex</span> = <span class="ruby-constant">EDIT_PATH_REGEX</span>
|
34
|
-
<span class="ruby-identifier">:edit</span>
|
35
|
-
<span class="ruby-keyword kw">end</span>
|
36
|
-
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">req</span>.<span class="ruby-identifier">delete?</span>
|
37
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">path</span> <span class="ruby-operator">=~</span> <span class="ruby-constant">PAGE_PATH_REGEX</span>
|
38
|
-
<span class="ruby-identifier">regex</span> = <span class="ruby-constant">PAGE_PATH_REGEX</span>
|
39
|
-
<span class="ruby-identifier">:delete</span>
|
40
|
-
<span class="ruby-keyword kw">end</span>
|
41
|
-
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">req</span>.<span class="ruby-identifier">put?</span>
|
42
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">path</span> <span class="ruby-operator">=~</span> <span class="ruby-constant">PAGE_PATH_REGEX</span>
|
43
|
-
<span class="ruby-identifier">regex</span> = <span class="ruby-constant">PAGE_PATH_REGEX</span>
|
44
|
-
<span class="ruby-identifier">:save</span>
|
45
|
-
<span class="ruby-keyword kw">end</span>
|
46
|
-
<span class="ruby-keyword kw">end</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">:not_found</span>
|
47
|
-
|
48
|
-
<span class="ruby-identifier">page_name</span> = <span class="ruby-identifier">regex</span>.<span class="ruby-identifier">match</span>(<span class="ruby-identifier">path</span>)[<span class="ruby-value">1</span>]
|
49
|
-
|
50
|
-
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">action</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:view</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">action</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:edit</span>)
|
51
|
-
<span class="ruby-keyword kw">begin</span>
|
52
|
-
<span class="ruby-identifier">page</span> = <span class="ruby-constant">Milk</span><span class="ruby-operator">::</span><span class="ruby-constant">Page</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">page_name</span>)
|
53
|
-
<span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Milk</span><span class="ruby-operator">::</span><span class="ruby-constant">PageNotFoundError</span>
|
54
|
-
<span class="ruby-identifier">action</span> = <span class="ruby-identifier">:not_found</span>
|
55
|
-
<span class="ruby-keyword kw">end</span>
|
56
|
-
<span class="ruby-keyword kw">end</span>
|
57
|
-
|
58
|
-
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">action</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:haxe</span>)
|
59
|
-
<span class="ruby-keyword kw">begin</span>
|
60
|
-
<span class="ruby-identifier">page</span> = <span class="ruby-constant">Milk</span><span class="ruby-operator">::</span><span class="ruby-constant">Haxe</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">page_name</span>)
|
61
|
-
<span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Milk</span><span class="ruby-operator">::</span><span class="ruby-constant">PageNotFoundError</span>
|
62
|
-
<span class="ruby-identifier">action</span> = <span class="ruby-identifier">:not_found</span>
|
63
|
-
<span class="ruby-keyword kw">end</span>
|
64
|
-
<span class="ruby-keyword kw">end</span>
|
65
|
-
|
66
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">action</span>, <span class="ruby-identifier">page_name</span>, <span class="ruby-identifier">page</span>
|
67
|
-
<span class="ruby-keyword kw">end</span></pre>
|
68
|
-
</body>
|
69
|
-
</html>
|
@@ -1,38 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
2
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
3
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
-
<head>
|
5
|
-
<title>call (Milk::Application)</title>
|
6
|
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
7
|
-
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
8
|
-
</head>
|
9
|
-
<body class="standalone-code">
|
10
|
-
<pre><span class="ruby-comment cmt"># File lib/milk/application.rb, line 67</span>
|
11
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">call</span>(<span class="ruby-identifier">env</span>)
|
12
|
-
<span class="ruby-identifier">req</span> = <span class="ruby-constant">Rack</span><span class="ruby-operator">::</span><span class="ruby-constant">Request</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">env</span>)
|
13
|
-
|
14
|
-
<span class="ruby-comment cmt"># Route the request</span>
|
15
|
-
<span class="ruby-identifier">action</span>, <span class="ruby-identifier">page_name</span>, <span class="ruby-identifier">page</span> = <span class="ruby-identifier">route</span>(<span class="ruby-identifier">req</span>)
|
16
|
-
|
17
|
-
<span class="ruby-comment cmt"># Send proper mime types for browsers that claim to accept it</span>
|
18
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">env</span>[<span class="ruby-value str">'HTTP_ACCEPT'</span>].<span class="ruby-identifier">include?</span> <span class="ruby-value str">"application/xhtml+xml"</span>
|
19
|
-
<span class="ruby-identifier">html_type</span> = <span class="ruby-value str">"application/xhtml+xml"</span>
|
20
|
-
<span class="ruby-keyword kw">else</span>
|
21
|
-
<span class="ruby-identifier">html_type</span> = <span class="ruby-value str">"text/html"</span>
|
22
|
-
<span class="ruby-keyword kw">end</span>
|
23
|
-
|
24
|
-
<span class="ruby-keyword kw">case</span> <span class="ruby-identifier">action</span>
|
25
|
-
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:haxe</span>
|
26
|
-
[<span class="ruby-value">200</span>, {<span class="ruby-value str">"Content-Type"</span>=<span class="ruby-operator">></span><span class="ruby-value str">"application/x-shockwave-flash"</span>}, [<span class="ruby-identifier">page</span>]]
|
27
|
-
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:not_found</span>
|
28
|
-
[<span class="ruby-value">404</span>, {<span class="ruby-value str">"Content-Type"</span>=<span class="ruby-operator">></span><span class="ruby-identifier">html_type</span>}, [<span class="ruby-constant">Milk</span><span class="ruby-operator">::</span><span class="ruby-constant">Page</span>.<span class="ruby-identifier">find</span>(<span class="ruby-value str">'NotFound'</span>).<span class="ruby-identifier">view</span>]]
|
29
|
-
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:view</span>
|
30
|
-
[<span class="ruby-value">200</span>, {<span class="ruby-value str">"Content-Type"</span>=<span class="ruby-operator">></span><span class="ruby-identifier">html_type</span>}, [<span class="ruby-identifier">page</span>.<span class="ruby-identifier">view</span>]]
|
31
|
-
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:edit</span>
|
32
|
-
[<span class="ruby-value">200</span>, {<span class="ruby-value str">"Content-Type"</span>=<span class="ruby-operator">></span><span class="ruby-identifier">html_type</span>}, [<span class="ruby-identifier">page</span>.<span class="ruby-identifier">edit</span>]]
|
33
|
-
<span class="ruby-keyword kw">else</span>
|
34
|
-
[<span class="ruby-value">500</span>, {<span class="ruby-value str">"Content-Type"</span>=<span class="ruby-operator">></span><span class="ruby-identifier">html_type</span>}, [<span class="ruby-identifier">action</span>.<span class="ruby-identifier">to_s</span>]]
|
35
|
-
<span class="ruby-keyword kw">end</span>
|
36
|
-
<span class="ruby-keyword kw">end</span></pre>
|
37
|
-
</body>
|
38
|
-
</html>
|
@@ -1,397 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
2
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
3
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
-
<head>
|
5
|
-
<title>Class: Milk::Component [RDoc Documentation]</title>
|
6
|
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
7
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
8
|
-
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
9
|
-
<script type="text/javascript">
|
10
|
-
// <![CDATA[
|
11
|
-
|
12
|
-
function popupCode( url ) {
|
13
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
14
|
-
}
|
15
|
-
|
16
|
-
function toggleCode( id ) {
|
17
|
-
if ( document.getElementById )
|
18
|
-
elem = document.getElementById( id );
|
19
|
-
else if ( document.all )
|
20
|
-
elem = eval( "document.all." + id );
|
21
|
-
else
|
22
|
-
return false;
|
23
|
-
|
24
|
-
elemStyle = elem.style;
|
25
|
-
|
26
|
-
if ( elemStyle.display != "block" ) {
|
27
|
-
elemStyle.display = "block"
|
28
|
-
} else {
|
29
|
-
elemStyle.display = "none"
|
30
|
-
}
|
31
|
-
|
32
|
-
return true;
|
33
|
-
}
|
34
|
-
|
35
|
-
// Make codeblocks hidden by default
|
36
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }<\/style>" )
|
37
|
-
|
38
|
-
// ]]>
|
39
|
-
</script>
|
40
|
-
|
41
|
-
</head>
|
42
|
-
<body>
|
43
|
-
|
44
|
-
|
45
|
-
<div id="classHeader">
|
46
|
-
<table class="header-table">
|
47
|
-
<tr class="top-aligned-row">
|
48
|
-
<td><strong>Class</strong></td>
|
49
|
-
<td class="class-name-in-header">Milk::Component</td>
|
50
|
-
</tr>
|
51
|
-
<tr class="top-aligned-row">
|
52
|
-
<td><strong>In:</strong></td>
|
53
|
-
<td>
|
54
|
-
|
55
|
-
|
56
|
-
<a href="../../files/lib/milk/component_rb.html">
|
57
|
-
|
58
|
-
lib/milk/component.rb
|
59
|
-
|
60
|
-
</a>
|
61
|
-
|
62
|
-
|
63
|
-
<br />
|
64
|
-
|
65
|
-
</td>
|
66
|
-
</tr>
|
67
|
-
|
68
|
-
|
69
|
-
<tr class="top-aligned-row">
|
70
|
-
<td><strong>Parent:</strong></td>
|
71
|
-
<td>
|
72
|
-
|
73
|
-
<a href="../Object.html">
|
74
|
-
|
75
|
-
Object
|
76
|
-
|
77
|
-
</a>
|
78
|
-
|
79
|
-
</td>
|
80
|
-
</tr>
|
81
|
-
|
82
|
-
</table>
|
83
|
-
</div>
|
84
|
-
<!-- banner header -->
|
85
|
-
|
86
|
-
<div id="bodyContent">
|
87
|
-
|
88
|
-
<div id="contextContent">
|
89
|
-
|
90
|
-
</div>
|
91
|
-
|
92
|
-
|
93
|
-
<div id="method-list">
|
94
|
-
<h3 class="section-bar">Methods</h3>
|
95
|
-
|
96
|
-
<div class="name-list">
|
97
|
-
|
98
|
-
<a href="#M000016">component_array</a>
|
99
|
-
|
100
|
-
<a href="#M000024">edit</a>
|
101
|
-
|
102
|
-
<a href="#M000015">global_properties</a>
|
103
|
-
|
104
|
-
<a href="#M000017">image_chooser</a>
|
105
|
-
|
106
|
-
<a href="#M000022">initilize</a>
|
107
|
-
|
108
|
-
<a href="#M000023">load_settings</a>
|
109
|
-
|
110
|
-
<a href="#M000014">local_properties</a>
|
111
|
-
|
112
|
-
<a href="#M000018">markdown_field</a>
|
113
|
-
|
114
|
-
<a href="#M000019">page_chooser</a>
|
115
|
-
|
116
|
-
<a href="#M000020">sprite_chooser</a>
|
117
|
-
|
118
|
-
<a href="#M000021">text_field</a>
|
119
|
-
|
120
|
-
<a href="#M000025">view</a>
|
121
|
-
|
122
|
-
</div>
|
123
|
-
</div>
|
124
|
-
|
125
|
-
</div>
|
126
|
-
|
127
|
-
<!-- if includes -->
|
128
|
-
|
129
|
-
<div id="section">
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
<!-- if method_list -->
|
135
|
-
|
136
|
-
<div id="methods">
|
137
|
-
|
138
|
-
<h3 class="section-bar">Public Class methods</h3>
|
139
|
-
|
140
|
-
|
141
|
-
<div id="method-M000016" class="method-detail">
|
142
|
-
<a name="M000016"></a>
|
143
|
-
|
144
|
-
<div class="method-heading">
|
145
|
-
|
146
|
-
<a href="Component.src/M000016.html" target="Code" class="method-signature"
|
147
|
-
onclick="popupCode('Component.src/M000016.html');return false;">
|
148
|
-
|
149
|
-
<span class="method-name">component_array</span><span class="method-args">(field, label, com_class)</span>
|
150
|
-
|
151
|
-
</a>
|
152
|
-
|
153
|
-
</div>
|
154
|
-
|
155
|
-
<div class="method-description">
|
156
|
-
|
157
|
-
</div>
|
158
|
-
</div>
|
159
|
-
|
160
|
-
|
161
|
-
<div id="method-M000015" class="method-detail">
|
162
|
-
<a name="M000015"></a>
|
163
|
-
|
164
|
-
<div class="method-heading">
|
165
|
-
|
166
|
-
<a href="Component.src/M000015.html" target="Code" class="method-signature"
|
167
|
-
onclick="popupCode('Component.src/M000015.html');return false;">
|
168
|
-
|
169
|
-
<span class="method-name">global_properties</span><span class="method-args">(*props)</span>
|
170
|
-
|
171
|
-
</a>
|
172
|
-
|
173
|
-
</div>
|
174
|
-
|
175
|
-
<div class="method-description">
|
176
|
-
|
177
|
-
</div>
|
178
|
-
</div>
|
179
|
-
|
180
|
-
|
181
|
-
<div id="method-M000017" class="method-detail">
|
182
|
-
<a name="M000017"></a>
|
183
|
-
|
184
|
-
<div class="method-heading">
|
185
|
-
|
186
|
-
<a href="Component.src/M000017.html" target="Code" class="method-signature"
|
187
|
-
onclick="popupCode('Component.src/M000017.html');return false;">
|
188
|
-
|
189
|
-
<span class="method-name">image_chooser</span><span class="method-args">(field, label, alt_field)</span>
|
190
|
-
|
191
|
-
</a>
|
192
|
-
|
193
|
-
</div>
|
194
|
-
|
195
|
-
<div class="method-description">
|
196
|
-
|
197
|
-
</div>
|
198
|
-
</div>
|
199
|
-
|
200
|
-
|
201
|
-
<div id="method-M000014" class="method-detail">
|
202
|
-
<a name="M000014"></a>
|
203
|
-
|
204
|
-
<div class="method-heading">
|
205
|
-
|
206
|
-
<a href="Component.src/M000014.html" target="Code" class="method-signature"
|
207
|
-
onclick="popupCode('Component.src/M000014.html');return false;">
|
208
|
-
|
209
|
-
<span class="method-name">local_properties</span><span class="method-args">(*props)</span>
|
210
|
-
|
211
|
-
</a>
|
212
|
-
|
213
|
-
</div>
|
214
|
-
|
215
|
-
<div class="method-description">
|
216
|
-
|
217
|
-
</div>
|
218
|
-
</div>
|
219
|
-
|
220
|
-
|
221
|
-
<div id="method-M000018" class="method-detail">
|
222
|
-
<a name="M000018"></a>
|
223
|
-
|
224
|
-
<div class="method-heading">
|
225
|
-
|
226
|
-
<a href="Component.src/M000018.html" target="Code" class="method-signature"
|
227
|
-
onclick="popupCode('Component.src/M000018.html');return false;">
|
228
|
-
|
229
|
-
<span class="method-name">markdown_field</span><span class="method-args">(field, label)</span>
|
230
|
-
|
231
|
-
</a>
|
232
|
-
|
233
|
-
</div>
|
234
|
-
|
235
|
-
<div class="method-description">
|
236
|
-
|
237
|
-
</div>
|
238
|
-
</div>
|
239
|
-
|
240
|
-
|
241
|
-
<div id="method-M000019" class="method-detail">
|
242
|
-
<a name="M000019"></a>
|
243
|
-
|
244
|
-
<div class="method-heading">
|
245
|
-
|
246
|
-
<a href="Component.src/M000019.html" target="Code" class="method-signature"
|
247
|
-
onclick="popupCode('Component.src/M000019.html');return false;">
|
248
|
-
|
249
|
-
<span class="method-name">page_chooser</span><span class="method-args">(field, label)</span>
|
250
|
-
|
251
|
-
</a>
|
252
|
-
|
253
|
-
</div>
|
254
|
-
|
255
|
-
<div class="method-description">
|
256
|
-
|
257
|
-
</div>
|
258
|
-
</div>
|
259
|
-
|
260
|
-
|
261
|
-
<div id="method-M000020" class="method-detail">
|
262
|
-
<a name="M000020"></a>
|
263
|
-
|
264
|
-
<div class="method-heading">
|
265
|
-
|
266
|
-
<a href="Component.src/M000020.html" target="Code" class="method-signature"
|
267
|
-
onclick="popupCode('Component.src/M000020.html');return false;">
|
268
|
-
|
269
|
-
<span class="method-name">sprite_chooser</span><span class="method-args">(field, label, main_class, sub_classes)</span>
|
270
|
-
|
271
|
-
</a>
|
272
|
-
|
273
|
-
</div>
|
274
|
-
|
275
|
-
<div class="method-description">
|
276
|
-
|
277
|
-
</div>
|
278
|
-
</div>
|
279
|
-
|
280
|
-
|
281
|
-
<div id="method-M000021" class="method-detail">
|
282
|
-
<a name="M000021"></a>
|
283
|
-
|
284
|
-
<div class="method-heading">
|
285
|
-
|
286
|
-
<a href="Component.src/M000021.html" target="Code" class="method-signature"
|
287
|
-
onclick="popupCode('Component.src/M000021.html');return false;">
|
288
|
-
|
289
|
-
<span class="method-name">text_field</span><span class="method-args">(field, label)</span>
|
290
|
-
|
291
|
-
</a>
|
292
|
-
|
293
|
-
</div>
|
294
|
-
|
295
|
-
<div class="method-description">
|
296
|
-
|
297
|
-
</div>
|
298
|
-
</div>
|
299
|
-
|
300
|
-
|
301
|
-
<h3 class="section-bar">Public Instance methods</h3>
|
302
|
-
|
303
|
-
|
304
|
-
<div id="method-M000024" class="method-detail">
|
305
|
-
<a name="M000024"></a>
|
306
|
-
|
307
|
-
<div class="method-heading">
|
308
|
-
|
309
|
-
<a href="Component.src/M000024.html" target="Code" class="method-signature"
|
310
|
-
onclick="popupCode('Component.src/M000024.html');return false;">
|
311
|
-
|
312
|
-
<span class="method-name">edit</span><span class="method-args">()</span>
|
313
|
-
|
314
|
-
</a>
|
315
|
-
|
316
|
-
</div>
|
317
|
-
|
318
|
-
<div class="method-description">
|
319
|
-
|
320
|
-
</div>
|
321
|
-
</div>
|
322
|
-
|
323
|
-
|
324
|
-
<div id="method-M000022" class="method-detail">
|
325
|
-
<a name="M000022"></a>
|
326
|
-
|
327
|
-
<div class="method-heading">
|
328
|
-
|
329
|
-
<a href="Component.src/M000022.html" target="Code" class="method-signature"
|
330
|
-
onclick="popupCode('Component.src/M000022.html');return false;">
|
331
|
-
|
332
|
-
<span class="method-name">initilize</span><span class="method-args">(*props)</span>
|
333
|
-
|
334
|
-
</a>
|
335
|
-
|
336
|
-
</div>
|
337
|
-
|
338
|
-
<div class="method-description">
|
339
|
-
|
340
|
-
</div>
|
341
|
-
</div>
|
342
|
-
|
343
|
-
|
344
|
-
<div id="method-M000023" class="method-detail">
|
345
|
-
<a name="M000023"></a>
|
346
|
-
|
347
|
-
<div class="method-heading">
|
348
|
-
|
349
|
-
<a href="Component.src/M000023.html" target="Code" class="method-signature"
|
350
|
-
onclick="popupCode('Component.src/M000023.html');return false;">
|
351
|
-
|
352
|
-
<span class="method-name">load_settings</span><span class="method-args">()</span>
|
353
|
-
|
354
|
-
</a>
|
355
|
-
|
356
|
-
</div>
|
357
|
-
|
358
|
-
<div class="method-description">
|
359
|
-
|
360
|
-
</div>
|
361
|
-
</div>
|
362
|
-
|
363
|
-
|
364
|
-
<div id="method-M000025" class="method-detail">
|
365
|
-
<a name="M000025"></a>
|
366
|
-
|
367
|
-
<div class="method-heading">
|
368
|
-
|
369
|
-
<a href="Component.src/M000025.html" target="Code" class="method-signature"
|
370
|
-
onclick="popupCode('Component.src/M000025.html');return false;">
|
371
|
-
|
372
|
-
<span class="method-name">view</span><span class="method-args">()</span>
|
373
|
-
|
374
|
-
</a>
|
375
|
-
|
376
|
-
</div>
|
377
|
-
|
378
|
-
<div class="method-description">
|
379
|
-
|
380
|
-
</div>
|
381
|
-
</div>
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
</div>
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
</div>
|
391
|
-
|
392
|
-
<div id="validator-badges">
|
393
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
394
|
-
</div>
|
395
|
-
|
396
|
-
</body>
|
397
|
-
</html>
|