easy_html_creator 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +11 -0
- data/Gemfile +3 -0
- data/LICENSE +1 -1
- data/README.md +20 -16
- data/bin/easy_html_creator +1 -0
- data/bin/ehc +5 -0
- data/dev_root/{test1 → demo-website}/coffee/test.coffee +0 -0
- data/dev_root/{test1 → demo-website}/helper/test_helper.rb +0 -0
- data/dev_root/{test1 → demo-website}/index.haml +4 -0
- data/dev_root/{test1 → demo-website}/layout.haml +0 -0
- data/dev_root/{test1 → demo-website}/partials/_assets.haml +0 -0
- data/dev_root/demo-website/partials/_footer.haml +1 -0
- data/dev_root/demo-website/partials/_header.haml +1 -0
- data/dev_root/{test1 → demo-website}/partials/_metadata.haml +1 -1
- data/dev_root/demo-website/public/images/easy-way.jpg +0 -0
- data/dev_root/{test1 → demo-website}/public/robots.txt +0 -0
- data/dev_root/{test1 → demo-website}/sass/main.sass +0 -0
- data/dev_root/documentation/dev_root.haml +41 -0
- data/dev_root/documentation/generate.haml +16 -0
- data/dev_root/documentation/index.haml +23 -0
- data/dev_root/documentation/layout.haml +11 -0
- data/dev_root/documentation/partials/_assets.haml +1 -0
- data/dev_root/documentation/partials/_header.haml +5 -0
- data/dev_root/documentation/partials/_metadata.haml +5 -0
- data/dev_root/documentation/public/doc/ActivesupportOverride.html +674 -0
- data/dev_root/documentation/public/doc/EhcCommandTasks.html +598 -0
- data/dev_root/documentation/public/doc/Generator.html +117 -0
- data/dev_root/documentation/public/doc/Generator/CoffeeGenerator.html +309 -0
- data/dev_root/documentation/public/doc/Generator/Context.html +437 -0
- data/dev_root/documentation/public/doc/Generator/Generator.html +552 -0
- data/dev_root/documentation/public/doc/Generator/HamlGenerator.html +406 -0
- data/dev_root/documentation/public/doc/Generator/SassGenerator.html +313 -0
- data/dev_root/documentation/public/doc/Generator/StructureGenerator.html +257 -0
- data/dev_root/documentation/public/doc/Server.html +165 -0
- data/dev_root/documentation/public/doc/Server/Dispatcher.html +377 -0
- data/dev_root/documentation/public/doc/Server/Request.html +730 -0
- data/dev_root/documentation/public/doc/Server/Response.html +642 -0
- data/dev_root/documentation/public/doc/Server/Server.html +356 -0
- data/dev_root/documentation/public/doc/_index.html +260 -0
- data/dev_root/documentation/public/doc/class_list.html +58 -0
- data/dev_root/documentation/public/doc/css/common.css +1 -0
- data/dev_root/documentation/public/doc/css/full_list.css +57 -0
- data/dev_root/documentation/public/doc/css/style.css +339 -0
- data/dev_root/documentation/public/doc/file.CHANGELOG.html +98 -0
- data/dev_root/documentation/public/doc/file.LICENSE.html +95 -0
- data/dev_root/documentation/public/doc/file.README.html +130 -0
- data/dev_root/documentation/public/doc/file_list.html +66 -0
- data/dev_root/documentation/public/doc/frames.html +26 -0
- data/dev_root/documentation/public/doc/index.html +130 -0
- data/dev_root/documentation/public/doc/js/app.js +219 -0
- data/dev_root/documentation/public/doc/js/full_list.js +181 -0
- data/dev_root/documentation/public/doc/js/jquery.js +4 -0
- data/dev_root/documentation/public/doc/method_list.html +429 -0
- data/dev_root/documentation/public/doc/top-level-namespace.html +114 -0
- data/dev_root/documentation/sass/main.sass +38 -0
- data/dev_root/documentation/server.haml +8 -0
- data/dev_root/documentation/yard.haml +1 -0
- data/lib/easy_html_creator.rb +4 -1
- data/lib/ehc_command_tasks.rb +112 -0
- data/lib/generator/generator.rb +2 -2
- data/lib/generator/haml_generator.rb +3 -0
- data/{dev_root/shared → lib/generator}/helper/activesupport_override.rb +6 -0
- data/lib/generator/structure_generator.rb +0 -2
- data/lib/server/dispatcher.rb +5 -2
- data/lib/server/request.rb +2 -1
- data/lib/server/server.rb +2 -2
- metadata +94 -96
- data/bin/generateFiles +0 -5
- data/bin/initDevRoot +0 -21
- data/bin/startServer +0 -3
- data/dev_root/test1/partials/_footer.haml +0 -1
- data/dev_root/test1/partials/_header.haml +0 -1
- data/dev_root/test2/coffee/test.coffee +0 -28
- data/dev_root/test2/index.haml +0 -4
- data/dev_root/test2/layout.haml +0 -7
- data/dev_root/test2/partials/title.haml +0 -1
- data/dev_root/test2/sass/test.sass +0 -3
@@ -0,0 +1,257 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Class: Generator::StructureGenerator
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.7.6
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../';
|
20
|
+
framesUrl = "../frames.html#!Generator/StructureGenerator.html";
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="../_index.html">Index (S)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../Generator.html" title="Generator (module)">Generator</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">StructureGenerator</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Class: Generator::StructureGenerator
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
<dt class="r1">Inherits:</dt>
|
75
|
+
<dd class="r1">
|
76
|
+
<span class="inheritName">Object</span>
|
77
|
+
|
78
|
+
<ul class="fullTree">
|
79
|
+
<li>Object</li>
|
80
|
+
|
81
|
+
<li class="next">Generator::StructureGenerator</li>
|
82
|
+
|
83
|
+
</ul>
|
84
|
+
<a href="#" class="inheritanceTree">show all</a>
|
85
|
+
|
86
|
+
</dd>
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
<dt class="r2 last">Defined in:</dt>
|
97
|
+
<dd class="r2 last">lib/generator/structure_generator.rb</dd>
|
98
|
+
|
99
|
+
</dl>
|
100
|
+
<div class="clear"></div>
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
<h2>
|
111
|
+
Instance Method Summary
|
112
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
113
|
+
</h2>
|
114
|
+
|
115
|
+
<ul class="summary">
|
116
|
+
|
117
|
+
<li class="public ">
|
118
|
+
<span class="summary_signature">
|
119
|
+
|
120
|
+
<a href="#copy_public_content-instance_method" title="#copy_public_content (instance method)">- (Object) <strong>copy_public_content</strong>(input_folder, output_folder) </a>
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
</span>
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
135
|
+
|
136
|
+
</li>
|
137
|
+
|
138
|
+
|
139
|
+
<li class="public ">
|
140
|
+
<span class="summary_signature">
|
141
|
+
|
142
|
+
<a href="#generate-instance_method" title="#generate (instance method)">- (Object) <strong>generate</strong>(input_folder, output_folder) </a>
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
</span>
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
157
|
+
|
158
|
+
</li>
|
159
|
+
|
160
|
+
|
161
|
+
</ul>
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
<div id="instance_method_details" class="method_details_list">
|
167
|
+
<h2>Instance Method Details</h2>
|
168
|
+
|
169
|
+
|
170
|
+
<div class="method_details first">
|
171
|
+
<h3 class="signature first" id="copy_public_content-instance_method">
|
172
|
+
|
173
|
+
- (<tt>Object</tt>) <strong>copy_public_content</strong>(input_folder, output_folder)
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
</h3><table class="source_code">
|
180
|
+
<tr>
|
181
|
+
<td>
|
182
|
+
<pre class="lines">
|
183
|
+
|
184
|
+
|
185
|
+
14
|
186
|
+
15
|
187
|
+
16
|
188
|
+
17
|
189
|
+
18
|
190
|
+
19</pre>
|
191
|
+
</td>
|
192
|
+
<td>
|
193
|
+
<pre class="code"><span class="info file"># File 'lib/generator/structure_generator.rb', line 14</span>
|
194
|
+
|
195
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_copy_public_content'>copy_public_content</span> <span class='id identifier rubyid_input_folder'>input_folder</span><span class='comma'>,</span> <span class='id identifier rubyid_output_folder'>output_folder</span>
|
196
|
+
<span class='id identifier rubyid_src_dir'>src_dir</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_input_folder'>input_folder</span><span class='embexpr_end'>}</span><span class='tstring_content'>/public</span><span class='tstring_end'>"</span></span>
|
197
|
+
<span class='kw'>return</span> <span class='kw'>unless</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_directory?'>directory?</span> <span class='id identifier rubyid_src_dir'>src_dir</span>
|
198
|
+
|
199
|
+
<span class='const'>FileUtils</span><span class='op'>::</span><span class='id identifier rubyid_copy_entry'>copy_entry</span><span class='lparen'>(</span><span class='id identifier rubyid_src_dir'>src_dir</span><span class='comma'>,</span> <span class='id identifier rubyid_output_folder'>output_folder</span><span class='rparen'>)</span>
|
200
|
+
<span class='kw'>end</span></pre>
|
201
|
+
</td>
|
202
|
+
</tr>
|
203
|
+
</table>
|
204
|
+
</div>
|
205
|
+
|
206
|
+
<div class="method_details ">
|
207
|
+
<h3 class="signature " id="generate-instance_method">
|
208
|
+
|
209
|
+
- (<tt>Object</tt>) <strong>generate</strong>(input_folder, output_folder)
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
</h3><table class="source_code">
|
216
|
+
<tr>
|
217
|
+
<td>
|
218
|
+
<pre class="lines">
|
219
|
+
|
220
|
+
|
221
|
+
5
|
222
|
+
6
|
223
|
+
7
|
224
|
+
8
|
225
|
+
9
|
226
|
+
10
|
227
|
+
11
|
228
|
+
12</pre>
|
229
|
+
</td>
|
230
|
+
<td>
|
231
|
+
<pre class="code"><span class="info file"># File 'lib/generator/structure_generator.rb', line 5</span>
|
232
|
+
|
233
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_generate'>generate</span> <span class='id identifier rubyid_input_folder'>input_folder</span><span class='comma'>,</span> <span class='id identifier rubyid_output_folder'>output_folder</span>
|
234
|
+
<span class='kw'>return</span> <span class='kw'>if</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_directory?'>directory?</span> <span class='id identifier rubyid_output_folder'>output_folder</span>
|
235
|
+
|
236
|
+
<span class='const'>FileUtils</span><span class='op'>::</span><span class='id identifier rubyid_mkdir_p'>mkdir_p</span> <span class='id identifier rubyid_output_folder'>output_folder</span>
|
237
|
+
<span class='id identifier rubyid_copy_public_content'>copy_public_content</span><span class='lparen'>(</span><span class='id identifier rubyid_input_folder'>input_folder</span><span class='comma'>,</span> <span class='id identifier rubyid_output_folder'>output_folder</span><span class='rparen'>)</span>
|
238
|
+
<span class='const'>FileUtils</span><span class='op'>::</span><span class='id identifier rubyid_mkdir_p'>mkdir_p</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_output_folder'>output_folder</span><span class='embexpr_end'>}</span><span class='tstring_content'>/css/</span><span class='tstring_end'>"</span></span>
|
239
|
+
<span class='const'>FileUtils</span><span class='op'>::</span><span class='id identifier rubyid_mkdir_p'>mkdir_p</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_output_folder'>output_folder</span><span class='embexpr_end'>}</span><span class='tstring_content'>/js/</span><span class='tstring_end'>"</span></span>
|
240
|
+
<span class='kw'>end</span></pre>
|
241
|
+
</td>
|
242
|
+
</tr>
|
243
|
+
</table>
|
244
|
+
</div>
|
245
|
+
|
246
|
+
</div>
|
247
|
+
|
248
|
+
</div>
|
249
|
+
|
250
|
+
<div id="footer">
|
251
|
+
Generated on Sun Dec 21 19:55:51 2014 by
|
252
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
253
|
+
0.8.7.6 (ruby-2.1.3).
|
254
|
+
</div>
|
255
|
+
|
256
|
+
</body>
|
257
|
+
</html>
|
@@ -0,0 +1,165 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Module: Server
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.7.6
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '';
|
20
|
+
framesUrl = "frames.html#!Server.html";
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="_index.html">Index (S)</a> »
|
35
|
+
|
36
|
+
|
37
|
+
<span class="title">Server</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Module: Server
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
<dt class="r1 last">Defined in:</dt>
|
82
|
+
<dd class="r1 last">lib/server/server.rb<span class="defines">,<br />
|
83
|
+
lib/server/request.rb,<br /> lib/server/response.rb,<br /> lib/server/dispatcher.rb</span>
|
84
|
+
</dd>
|
85
|
+
|
86
|
+
</dl>
|
87
|
+
<div class="clear"></div>
|
88
|
+
|
89
|
+
<h2>Defined Under Namespace</h2>
|
90
|
+
<p class="children">
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Server/Dispatcher.html" title="Server::Dispatcher (class)">Dispatcher</a></span>, <span class='object_link'><a href="Server/Request.html" title="Server::Request (class)">Request</a></span>, <span class='object_link'><a href="Server/Response.html" title="Server::Response (class)">Response</a></span>, <span class='object_link'><a href="Server/Server.html" title="Server::Server (class)">Server</a></span>
|
96
|
+
|
97
|
+
|
98
|
+
</p>
|
99
|
+
|
100
|
+
<h2>Constant Summary</h2>
|
101
|
+
|
102
|
+
<dl class="constants">
|
103
|
+
|
104
|
+
<dt id="CONTENT_TYPE_MAPPING-constant" class="">CONTENT_TYPE_MAPPING =
|
105
|
+
<div class="docstring">
|
106
|
+
<div class="discussion">
|
107
|
+
|
108
|
+
<p>Map extensions to their content type</p>
|
109
|
+
|
110
|
+
|
111
|
+
</div>
|
112
|
+
</div>
|
113
|
+
<div class="tags">
|
114
|
+
|
115
|
+
|
116
|
+
</div>
|
117
|
+
</dt>
|
118
|
+
<dd><pre class="code"><span class='lbrace'>{</span>
|
119
|
+
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>html</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>text/html</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
120
|
+
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>txt</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>text/plain</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
121
|
+
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>png</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>image/png</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
122
|
+
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>jpg</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>image/jpeg</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
123
|
+
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>ico</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>image/x-icon</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
124
|
+
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>js</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>text/javascript</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
125
|
+
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>css</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>text/css</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
126
|
+
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>php</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>text/html</span><span class='tstring_end'>'</span></span>
|
127
|
+
<span class='rbrace'>}</span></pre></dd>
|
128
|
+
|
129
|
+
<dt id="DEFAULT_CONTENT_TYPE-constant" class="">DEFAULT_CONTENT_TYPE =
|
130
|
+
<div class="docstring">
|
131
|
+
<div class="discussion">
|
132
|
+
|
133
|
+
<p>Treat as binary data if content type cannot be found</p>
|
134
|
+
|
135
|
+
|
136
|
+
</div>
|
137
|
+
</div>
|
138
|
+
<div class="tags">
|
139
|
+
|
140
|
+
|
141
|
+
</div>
|
142
|
+
</dt>
|
143
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>application/octet-stream</span><span class='tstring_end'>'</span></span></pre></dd>
|
144
|
+
|
145
|
+
</dl>
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
</div>
|
157
|
+
|
158
|
+
<div id="footer">
|
159
|
+
Generated on Sun Dec 21 19:55:50 2014 by
|
160
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
161
|
+
0.8.7.6 (ruby-2.1.3).
|
162
|
+
</div>
|
163
|
+
|
164
|
+
</body>
|
165
|
+
</html>
|
@@ -0,0 +1,377 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Class: Server::Dispatcher
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.7.6
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../';
|
20
|
+
framesUrl = "../frames.html#!Server/Dispatcher.html";
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="../_index.html">Index (D)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../Server.html" title="Server (module)">Server</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">Dispatcher</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Class: Server::Dispatcher
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
<dt class="r1">Inherits:</dt>
|
75
|
+
<dd class="r1">
|
76
|
+
<span class="inheritName">Object</span>
|
77
|
+
|
78
|
+
<ul class="fullTree">
|
79
|
+
<li>Object</li>
|
80
|
+
|
81
|
+
<li class="next">Server::Dispatcher</li>
|
82
|
+
|
83
|
+
</ul>
|
84
|
+
<a href="#" class="inheritanceTree">show all</a>
|
85
|
+
|
86
|
+
</dd>
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
<dt class="r2 last">Defined in:</dt>
|
97
|
+
<dd class="r2 last">lib/server/dispatcher.rb</dd>
|
98
|
+
|
99
|
+
</dl>
|
100
|
+
<div class="clear"></div>
|
101
|
+
|
102
|
+
|
103
|
+
<h2>Constant Summary</h2>
|
104
|
+
|
105
|
+
<dl class="constants">
|
106
|
+
|
107
|
+
<dt id="WEB_ROOT-constant" class="">WEB_ROOT =
|
108
|
+
|
109
|
+
</dt>
|
110
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>web_root</span><span class='tstring_end'>'</span></span></pre></dd>
|
111
|
+
|
112
|
+
</dl>
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
<h2>
|
123
|
+
Instance Method Summary
|
124
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
125
|
+
</h2>
|
126
|
+
|
127
|
+
<ul class="summary">
|
128
|
+
|
129
|
+
<li class="public ">
|
130
|
+
<span class="summary_signature">
|
131
|
+
|
132
|
+
<a href="#dispatch-instance_method" title="#dispatch (instance method)">- (Object) <strong>dispatch</strong>(request, response, server) </a>
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
</span>
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
147
|
+
|
148
|
+
</li>
|
149
|
+
|
150
|
+
|
151
|
+
<li class="public ">
|
152
|
+
<span class="summary_signature">
|
153
|
+
|
154
|
+
<a href="#execute_php-instance_method" title="#execute_php (instance method)">- (Object) <strong>execute_php</strong>(path, params) </a>
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
</span>
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
169
|
+
|
170
|
+
</li>
|
171
|
+
|
172
|
+
|
173
|
+
<li class="public ">
|
174
|
+
<span class="summary_signature">
|
175
|
+
|
176
|
+
<a href="#regenerate_files_if-instance_method" title="#regenerate_files_if (instance method)">- (Object) <strong>regenerate_files_if</strong>(path, server) </a>
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
</span>
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
191
|
+
|
192
|
+
</li>
|
193
|
+
|
194
|
+
|
195
|
+
</ul>
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
<div id="instance_method_details" class="method_details_list">
|
201
|
+
<h2>Instance Method Details</h2>
|
202
|
+
|
203
|
+
|
204
|
+
<div class="method_details first">
|
205
|
+
<h3 class="signature first" id="dispatch-instance_method">
|
206
|
+
|
207
|
+
- (<tt>Object</tt>) <strong>dispatch</strong>(request, response, server)
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
</h3><table class="source_code">
|
214
|
+
<tr>
|
215
|
+
<td>
|
216
|
+
<pre class="lines">
|
217
|
+
|
218
|
+
|
219
|
+
30
|
220
|
+
31
|
221
|
+
32
|
222
|
+
33
|
223
|
+
34
|
224
|
+
35
|
225
|
+
36
|
226
|
+
37
|
227
|
+
38
|
228
|
+
39
|
229
|
+
40
|
230
|
+
41
|
231
|
+
42
|
232
|
+
43
|
233
|
+
44
|
234
|
+
45
|
235
|
+
46
|
236
|
+
47
|
237
|
+
48
|
238
|
+
49
|
239
|
+
50
|
240
|
+
51
|
241
|
+
52
|
242
|
+
53</pre>
|
243
|
+
</td>
|
244
|
+
<td>
|
245
|
+
<pre class="code"><span class="info file"># File 'lib/server/dispatcher.rb', line 30</span>
|
246
|
+
|
247
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_dispatch'>dispatch</span><span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='comma'>,</span> <span class='id identifier rubyid_response'>response</span><span class='comma'>,</span> <span class='id identifier rubyid_server'>server</span><span class='rparen'>)</span>
|
248
|
+
<span class='id identifier rubyid_path'>path</span> <span class='op'>=</span> <span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_path'>path</span>
|
249
|
+
<span class='id identifier rubyid_server'>server</span><span class='period'>.</span><span class='id identifier rubyid_log'>log</span> <span class='id identifier rubyid_path'>path</span>
|
250
|
+
|
251
|
+
<span class='id identifier rubyid_regenerate_files_if'>regenerate_files_if</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='id identifier rubyid_server'>server</span><span class='rparen'>)</span>
|
252
|
+
<span class='comment'># Make sure the file exists and is not a directory
|
253
|
+
</span> <span class='comment'># before attempting to open it.
|
254
|
+
</span> <span class='kw'>if</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_exist?'>exist?</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='op'>!</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_directory?'>directory?</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span>
|
255
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_path'>path</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>.php</span><span class='tstring_end'>'</span></span>
|
256
|
+
<span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='int'>200</span><span class='comma'>,</span> <span class='id identifier rubyid_execute_php'>execute_php</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
257
|
+
<span class='kw'>else</span>
|
258
|
+
<span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_send_file'>send_file</span> <span class='id identifier rubyid_path'>path</span>
|
259
|
+
<span class='kw'>end</span>
|
260
|
+
<span class='kw'>elsif</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_exist?'>exist?</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_directory?'>directory?</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span>
|
261
|
+
<span class='id identifier rubyid_path'>path</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_path'>path</span><span class='embexpr_end'>}</span><span class='tstring_content'>/index.html</span><span class='tstring_end'>"</span></span>
|
262
|
+
<span class='kw'>if</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_exist?'>exist?</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='op'>!</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_directory?'>directory?</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span>
|
263
|
+
<span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_send_301'>send_301</span> <span class='id identifier rubyid_path'>path</span>
|
264
|
+
<span class='kw'>else</span>
|
265
|
+
<span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_send_404'>send_404</span>
|
266
|
+
<span class='kw'>end</span>
|
267
|
+
<span class='kw'>else</span>
|
268
|
+
<span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_send_404'>send_404</span>
|
269
|
+
<span class='kw'>end</span>
|
270
|
+
<span class='kw'>end</span></pre>
|
271
|
+
</td>
|
272
|
+
</tr>
|
273
|
+
</table>
|
274
|
+
</div>
|
275
|
+
|
276
|
+
<div class="method_details ">
|
277
|
+
<h3 class="signature " id="execute_php-instance_method">
|
278
|
+
|
279
|
+
- (<tt>Object</tt>) <strong>execute_php</strong>(path, params)
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
|
284
|
+
|
285
|
+
</h3><table class="source_code">
|
286
|
+
<tr>
|
287
|
+
<td>
|
288
|
+
<pre class="lines">
|
289
|
+
|
290
|
+
|
291
|
+
7
|
292
|
+
8
|
293
|
+
9
|
294
|
+
10
|
295
|
+
11
|
296
|
+
12
|
297
|
+
13
|
298
|
+
14
|
299
|
+
15
|
300
|
+
16</pre>
|
301
|
+
</td>
|
302
|
+
<td>
|
303
|
+
<pre class="code"><span class="info file"># File 'lib/server/dispatcher.rb', line 7</span>
|
304
|
+
|
305
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_execute_php'>execute_php</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
|
306
|
+
<span class='id identifier rubyid_params_s'>params_s</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span>
|
307
|
+
<span class='id identifier rubyid_params'>params</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>|</span>
|
308
|
+
<span class='id identifier rubyid_params_s'>params_s</span><span class='op'>+=</span><span class='id identifier rubyid_key'>key</span><span class='op'>+</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>=</span><span class='tstring_end'>'</span></span><span class='op'>+</span><span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='op'>+</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'> </span><span class='tstring_end'>'</span></span>
|
309
|
+
<span class='kw'>end</span>
|
310
|
+
<span class='id identifier rubyid_executors'>executors</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>php</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>php-cgi</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>php-fpm</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
|
311
|
+
<span class='id identifier rubyid_cmd'>cmd</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_executors'>executors</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_path'>path</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_params_s'>params_s</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
312
|
+
<span class='const'>STDERR</span><span class='period'>.</span><span class='id identifier rubyid_puts'>puts</span><span class='lparen'>(</span><span class='id identifier rubyid_cmd'>cmd</span><span class='rparen'>)</span>
|
313
|
+
<span class='backtick'>%x[</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cmd'>cmd</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='tstring_end'>]</span></span>
|
314
|
+
<span class='kw'>end</span></pre>
|
315
|
+
</td>
|
316
|
+
</tr>
|
317
|
+
</table>
|
318
|
+
</div>
|
319
|
+
|
320
|
+
<div class="method_details ">
|
321
|
+
<h3 class="signature " id="regenerate_files_if-instance_method">
|
322
|
+
|
323
|
+
- (<tt>Object</tt>) <strong>regenerate_files_if</strong>(path, server)
|
324
|
+
|
325
|
+
|
326
|
+
|
327
|
+
|
328
|
+
|
329
|
+
</h3><table class="source_code">
|
330
|
+
<tr>
|
331
|
+
<td>
|
332
|
+
<pre class="lines">
|
333
|
+
|
334
|
+
|
335
|
+
18
|
336
|
+
19
|
337
|
+
20
|
338
|
+
21
|
339
|
+
22
|
340
|
+
23
|
341
|
+
24
|
342
|
+
25
|
343
|
+
26
|
344
|
+
27
|
345
|
+
28</pre>
|
346
|
+
</td>
|
347
|
+
<td>
|
348
|
+
<pre class="code"><span class="info file"># File 'lib/server/dispatcher.rb', line 18</span>
|
349
|
+
|
350
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_regenerate_files_if'>regenerate_files_if</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='id identifier rubyid_server'>server</span><span class='rparen'>)</span>
|
351
|
+
<span class='kw'>return</span> <span class='kw'>unless</span> <span class='id identifier rubyid_path'>path</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>.html</span><span class='tstring_end'>'</span></span>
|
352
|
+
|
353
|
+
<span class='comment'>#no html? no reload -> no regenarate
|
354
|
+
</span> <span class='id identifier rubyid_server'>server</span><span class='period'>.</span><span class='id identifier rubyid_log'>log</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>#######################</span><span class='tstring_end'>"</span></span>
|
355
|
+
<span class='id identifier rubyid_server'>server</span><span class='period'>.</span><span class='id identifier rubyid_log'>log</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'># #</span><span class='tstring_end'>"</span></span>
|
356
|
+
<span class='id identifier rubyid_server'>server</span><span class='period'>.</span><span class='id identifier rubyid_log'>log</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'># Renew all files #</span><span class='tstring_end'>"</span></span>
|
357
|
+
<span class='id identifier rubyid_server'>server</span><span class='period'>.</span><span class='id identifier rubyid_log'>log</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'># #</span><span class='tstring_end'>"</span></span>
|
358
|
+
<span class='id identifier rubyid_server'>server</span><span class='period'>.</span><span class='id identifier rubyid_log'>log</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>#######################</span><span class='tstring_end'>"</span></span>
|
359
|
+
<span class='const'>Generator</span><span class='op'>::</span><span class='const'>Generator</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='period'>.</span><span class='id identifier rubyid_generate'>generate</span>
|
360
|
+
<span class='kw'>end</span></pre>
|
361
|
+
</td>
|
362
|
+
</tr>
|
363
|
+
</table>
|
364
|
+
</div>
|
365
|
+
|
366
|
+
</div>
|
367
|
+
|
368
|
+
</div>
|
369
|
+
|
370
|
+
<div id="footer">
|
371
|
+
Generated on Sun Dec 21 19:55:50 2014 by
|
372
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
373
|
+
0.8.7.6 (ruby-2.1.3).
|
374
|
+
</div>
|
375
|
+
|
376
|
+
</body>
|
377
|
+
</html>
|