ymdp 0.9.2 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +2 -1
- data/VERSION +1 -1
- data/doc/ActionView.html +175 -0
- data/doc/ActionView/Helpers.html +175 -0
- data/doc/ActionView/Helpers/TagHelper.html +439 -0
- data/doc/Application.html +295 -0
- data/doc/LICENSE.html +158 -0
- data/doc/Object.html +218 -0
- data/doc/README_rdoc.html +147 -0
- data/doc/YMDP.html +232 -0
- data/doc/YMDP/ApplicationView.html +563 -0
- data/doc/YMDP/AssetTagHelper.html +235 -0
- data/doc/YMDP/Base.html +560 -0
- data/doc/YMDP/Compiler.html +178 -0
- data/doc/YMDP/Compiler/Base.html +1181 -0
- data/doc/YMDP/Compiler/Domains.html +493 -0
- data/doc/YMDP/Compiler/Options.html +265 -0
- data/doc/YMDP/Compiler/Template.html +175 -0
- data/doc/YMDP/Compiler/Template/Base.html +911 -0
- data/doc/YMDP/Compiler/Template/CoffeeScript.html +236 -0
- data/doc/YMDP/Compiler/Template/JavaScript.html +237 -0
- data/doc/YMDP/Compiler/Template/View.html +495 -0
- data/doc/YMDP/Compiler/Template/YRB.html +469 -0
- data/doc/YMDP/Configuration.html +175 -0
- data/doc/YMDP/Configuration/Base.html +426 -0
- data/doc/YMDP/Configuration/Config.html +553 -0
- data/doc/YMDP/Configuration/Servers.html +265 -0
- data/doc/YMDP/Configuration/Setter.html +580 -0
- data/doc/YMDP/FormTagHelper.html +298 -0
- data/doc/YMDP/GitHelper.html +298 -0
- data/doc/YMDP/LinkTagHelper.html +299 -0
- data/doc/YMDP/View.html +239 -0
- data/doc/created.rid +18 -0
- data/doc/images/add.png +0 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/transparent.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +134 -0
- data/doc/js/darkfish.js +153 -0
- data/doc/js/jquery.js +18 -0
- data/doc/js/navigation.js +142 -0
- data/doc/js/search.js +94 -0
- data/doc/js/search_index.js +1 -0
- data/doc/js/searcher.js +228 -0
- data/doc/rdoc.css +543 -0
- data/doc/table_of_contents.html +401 -0
- data/lib/ymdp/compiler/template.rb +5 -1
- data/lib/ymdp/view/application_view.rb +10 -5
- data/ymdp.gemspec +69 -2
- metadata +120 -42
@@ -0,0 +1,265 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
6
|
+
|
7
|
+
<title>class YMDP::Compiler::Options - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<link type="text/css" media="screen" href="../../rdoc.css" rel="stylesheet">
|
10
|
+
|
11
|
+
<script type="text/javascript">
|
12
|
+
var rdoc_rel_prefix = "../../";
|
13
|
+
</script>
|
14
|
+
|
15
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
16
|
+
<script type="text/javascript" charset="utf-8" src="../../js/navigation.js"></script>
|
17
|
+
<script type="text/javascript" charset="utf-8" src="../../js/search_index.js"></script>
|
18
|
+
<script type="text/javascript" charset="utf-8" src="../../js/search.js"></script>
|
19
|
+
<script type="text/javascript" charset="utf-8" src="../../js/searcher.js"></script>
|
20
|
+
<script type="text/javascript" charset="utf-8" src="../../js/darkfish.js"></script>
|
21
|
+
|
22
|
+
|
23
|
+
<body id="top" class="class">
|
24
|
+
<nav id="metadata">
|
25
|
+
<nav id="home-section" class="section">
|
26
|
+
<h3 class="section-header">
|
27
|
+
<a href="../../index.html">Home</a>
|
28
|
+
<a href="../../table_of_contents.html#classes">Classes</a>
|
29
|
+
<a href="../../table_of_contents.html#methods">Methods</a>
|
30
|
+
</h3>
|
31
|
+
</nav>
|
32
|
+
|
33
|
+
|
34
|
+
<nav id="search-section" class="section project-section" class="initially-hidden">
|
35
|
+
<form action="#" method="get" accept-charset="utf-8">
|
36
|
+
<h3 class="section-header">
|
37
|
+
<input type="text" name="search" placeholder="Search" id="search-field"
|
38
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
39
|
+
</h3>
|
40
|
+
</form>
|
41
|
+
|
42
|
+
<ul id="search-results" class="initially-hidden"></ul>
|
43
|
+
</nav>
|
44
|
+
|
45
|
+
|
46
|
+
<div id="file-metadata">
|
47
|
+
<nav id="file-list-section" class="section">
|
48
|
+
<h3 class="section-header">Defined In</h3>
|
49
|
+
<ul>
|
50
|
+
<li>lib/ymdp/compiler/options.rb
|
51
|
+
</ul>
|
52
|
+
</nav>
|
53
|
+
|
54
|
+
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<div id="class-metadata">
|
58
|
+
|
59
|
+
<nav id="parent-class-section" class="section">
|
60
|
+
<h3 class="section-header">Parent</h3>
|
61
|
+
|
62
|
+
<p class="link"><a href="../../Object.html">Object</a>
|
63
|
+
|
64
|
+
</nav>
|
65
|
+
|
66
|
+
|
67
|
+
<!-- Method Quickref -->
|
68
|
+
<nav id="method-list-section" class="section">
|
69
|
+
<h3 class="section-header">Methods</h3>
|
70
|
+
|
71
|
+
<ul class="link-list">
|
72
|
+
|
73
|
+
<li><a href="#method-c-parse">::parse</a>
|
74
|
+
|
75
|
+
</ul>
|
76
|
+
</nav>
|
77
|
+
|
78
|
+
</div>
|
79
|
+
|
80
|
+
<div id="project-metadata">
|
81
|
+
<nav id="fileindex-section" class="section project-section">
|
82
|
+
<h3 class="section-header">Pages</h3>
|
83
|
+
|
84
|
+
<ul>
|
85
|
+
|
86
|
+
<li class="file"><a href="../../LICENSE.html">LICENSE</a>
|
87
|
+
|
88
|
+
<li class="file"><a href="../../README_rdoc.html">README</a>
|
89
|
+
|
90
|
+
</ul>
|
91
|
+
</nav>
|
92
|
+
|
93
|
+
<nav id="classindex-section" class="section project-section">
|
94
|
+
<h3 class="section-header">Class and Module Index</h3>
|
95
|
+
|
96
|
+
<ul class="link-list">
|
97
|
+
|
98
|
+
<li><a href="../../YMDP.html">YMDP</a>
|
99
|
+
|
100
|
+
<li><a href="../../YMDP/ApplicationView.html">YMDP::ApplicationView</a>
|
101
|
+
|
102
|
+
<li><a href="../../YMDP/AssetTagHelper.html">YMDP::AssetTagHelper</a>
|
103
|
+
|
104
|
+
<li><a href="../../YMDP/Base.html">YMDP::Base</a>
|
105
|
+
|
106
|
+
<li><a href="../../YMDP/Compiler.html">YMDP::Compiler</a>
|
107
|
+
|
108
|
+
<li><a href="../../YMDP/Compiler/Base.html">YMDP::Compiler::Base</a>
|
109
|
+
|
110
|
+
<li><a href="../../YMDP/Compiler/Domains.html">YMDP::Compiler::Domains</a>
|
111
|
+
|
112
|
+
<li><a href="../../YMDP/Compiler/Options.html">YMDP::Compiler::Options</a>
|
113
|
+
|
114
|
+
<li><a href="../../YMDP/Compiler/Template.html">YMDP::Compiler::Template</a>
|
115
|
+
|
116
|
+
<li><a href="../../YMDP/Compiler/Template/Base.html">YMDP::Compiler::Template::Base</a>
|
117
|
+
|
118
|
+
<li><a href="../../YMDP/Compiler/Template/CoffeeScript.html">YMDP::Compiler::Template::CoffeeScript</a>
|
119
|
+
|
120
|
+
<li><a href="../../YMDP/Compiler/Template/JavaScript.html">YMDP::Compiler::Template::JavaScript</a>
|
121
|
+
|
122
|
+
<li><a href="../../YMDP/Compiler/Template/View.html">YMDP::Compiler::Template::View</a>
|
123
|
+
|
124
|
+
<li><a href="../../YMDP/Compiler/Template/YRB.html">YMDP::Compiler::Template::YRB</a>
|
125
|
+
|
126
|
+
<li><a href="../../YMDP/Configuration.html">YMDP::Configuration</a>
|
127
|
+
|
128
|
+
<li><a href="../../YMDP/Configuration/Base.html">YMDP::Configuration::Base</a>
|
129
|
+
|
130
|
+
<li><a href="../../YMDP/Configuration/Config.html">YMDP::Configuration::Config</a>
|
131
|
+
|
132
|
+
<li><a href="../../YMDP/Configuration/Servers.html">YMDP::Configuration::Servers</a>
|
133
|
+
|
134
|
+
<li><a href="../../YMDP/Configuration/Setter.html">YMDP::Configuration::Setter</a>
|
135
|
+
|
136
|
+
<li><a href="../../YMDP/FormTagHelper.html">YMDP::FormTagHelper</a>
|
137
|
+
|
138
|
+
<li><a href="../../YMDP/GitHelper.html">YMDP::GitHelper</a>
|
139
|
+
|
140
|
+
<li><a href="../../YMDP/LinkTagHelper.html">YMDP::LinkTagHelper</a>
|
141
|
+
|
142
|
+
<li><a href="../../YMDP/View.html">YMDP::View</a>
|
143
|
+
|
144
|
+
<li><a href="../../ActionView.html">ActionView</a>
|
145
|
+
|
146
|
+
<li><a href="../../ActionView/Helpers.html">ActionView::Helpers</a>
|
147
|
+
|
148
|
+
<li><a href="../../ActionView/Helpers/TagHelper.html">ActionView::Helpers::TagHelper</a>
|
149
|
+
|
150
|
+
<li><a href="../../Application.html">Application</a>
|
151
|
+
|
152
|
+
<li><a href="../../Object.html">Object</a>
|
153
|
+
|
154
|
+
</ul>
|
155
|
+
</nav>
|
156
|
+
|
157
|
+
</div>
|
158
|
+
</nav>
|
159
|
+
|
160
|
+
<div id="documentation">
|
161
|
+
<h1 class="class">class YMDP::Compiler::Options</h1>
|
162
|
+
|
163
|
+
<div id="description" class="description">
|
164
|
+
|
165
|
+
<p>Command-line options processor for <a href="../Compiler.html">Compiler</a>
|
166
|
+
module.</p>
|
167
|
+
|
168
|
+
</div><!-- description -->
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
<!-- Methods -->
|
183
|
+
|
184
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section section">
|
185
|
+
<h3 class="section-header">Public Class Methods</h3>
|
186
|
+
|
187
|
+
|
188
|
+
<div id="method-c-parse" class="method-detail ">
|
189
|
+
|
190
|
+
<div class="method-heading">
|
191
|
+
<span class="method-name">parse</span><span
|
192
|
+
class="method-args">()</span>
|
193
|
+
<span class="method-click-advice">click to toggle source</span>
|
194
|
+
</div>
|
195
|
+
|
196
|
+
|
197
|
+
<div class="method-description">
|
198
|
+
|
199
|
+
<p>Parse command line options into an options hash.</p>
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
<div class="method-source-code" id="parse-source">
|
204
|
+
<pre><span class="ruby-comment"># File lib/ymdp/compiler/options.rb, line 8</span>
|
205
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">parse</span>
|
206
|
+
<span class="ruby-identifier">options</span> = {
|
207
|
+
<span class="ruby-value">:commit</span> =<span class="ruby-operator">></span> <span class="ruby-keyword">false</span>,
|
208
|
+
<span class="ruby-value">:branch</span> =<span class="ruby-operator">></span> <span class="ruby-string">"master"</span>,
|
209
|
+
<span class="ruby-value">:base_path</span> =<span class="ruby-operator">></span> <span class="ruby-constant">BASE_PATH</span>,
|
210
|
+
<span class="ruby-value">:servers</span> =<span class="ruby-operator">></span> <span class="ruby-constant">SERVERS</span>
|
211
|
+
}
|
212
|
+
<span class="ruby-constant">OptionParser</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">opts</span><span class="ruby-operator">|</span>
|
213
|
+
<span class="ruby-identifier">options</span>[<span class="ruby-value">:commit</span>] = <span class="ruby-keyword">false</span>
|
214
|
+
<span class="ruby-identifier">options</span>[<span class="ruby-value">:verbose</span>] = <span class="ruby-constant">CONFIG</span>.<span class="ruby-identifier">verbose?</span>
|
215
|
+
<span class="ruby-identifier">opts</span>.<span class="ruby-identifier">banner</span> = <span class="ruby-string">"Usage: build.rb [options]"</span>
|
216
|
+
|
217
|
+
<span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-string">"-d"</span>, <span class="ruby-string">"--domain [domain]"</span>, <span class="ruby-string">"Force Domain"</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
|
218
|
+
<span class="ruby-identifier">options</span>[<span class="ruby-value">:domain</span>] = <span class="ruby-identifier">v</span>
|
219
|
+
<span class="ruby-keyword">end</span>
|
220
|
+
<span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-string">"-b"</span>, <span class="ruby-string">"--branch [branch]"</span>, <span class="ruby-string">"Current Branch"</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
|
221
|
+
<span class="ruby-identifier">options</span>[<span class="ruby-value">:branch</span>] = <span class="ruby-identifier">v</span>
|
222
|
+
<span class="ruby-keyword">end</span>
|
223
|
+
<span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-string">"-m"</span>, <span class="ruby-string">"--message [message]"</span>, <span class="ruby-string">"Commit Message"</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
|
224
|
+
<span class="ruby-identifier">options</span>[<span class="ruby-value">:commit</span>] = <span class="ruby-keyword">true</span>
|
225
|
+
<span class="ruby-identifier">options</span>[<span class="ruby-value">:message</span>] = <span class="ruby-identifier">v</span>
|
226
|
+
<span class="ruby-keyword">end</span>
|
227
|
+
<span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-string">"-n"</span>, <span class="ruby-string">"--no-commit"</span>, <span class="ruby-string">"Don't Commit"</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
|
228
|
+
<span class="ruby-identifier">options</span>[<span class="ruby-value">:commit</span>] = <span class="ruby-keyword">false</span>
|
229
|
+
<span class="ruby-keyword">end</span>
|
230
|
+
<span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-string">"-v"</span>, <span class="ruby-string">"--verbose"</span>, <span class="ruby-string">"Verbose (show all file writes)"</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
|
231
|
+
<span class="ruby-identifier">options</span>[<span class="ruby-value">:verbose</span>] = <span class="ruby-keyword">true</span>
|
232
|
+
<span class="ruby-keyword">end</span>
|
233
|
+
<span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-string">"-r"</span>, <span class="ruby-string">"--rake [task]"</span>, <span class="ruby-string">"Execute Rake task"</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
|
234
|
+
<span class="ruby-identifier">options</span>[<span class="ruby-value">:rake</span>] = <span class="ruby-identifier">v</span>
|
235
|
+
<span class="ruby-keyword">end</span>
|
236
|
+
<span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-string">"-c"</span>, <span class="ruby-string">"--compress"</span>, <span class="ruby-string">"Compress JavaScript and CSS"</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
|
237
|
+
<span class="ruby-identifier">options</span>[<span class="ruby-value">:compress</span>] = <span class="ruby-identifier">v</span>
|
238
|
+
<span class="ruby-keyword">end</span>
|
239
|
+
<span class="ruby-keyword">end</span>.<span class="ruby-identifier">parse!</span>
|
240
|
+
|
241
|
+
<span class="ruby-identifier">options</span>
|
242
|
+
<span class="ruby-keyword">end</span></pre>
|
243
|
+
</div><!-- parse-source -->
|
244
|
+
|
245
|
+
</div>
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
</div><!-- parse-method -->
|
251
|
+
|
252
|
+
|
253
|
+
</section><!-- public-class-method-details -->
|
254
|
+
|
255
|
+
</section><!-- 5Buntitled-5D -->
|
256
|
+
|
257
|
+
</div><!-- documentation -->
|
258
|
+
|
259
|
+
|
260
|
+
<footer id="validator-badges">
|
261
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
262
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
|
263
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
264
|
+
</footer>
|
265
|
+
|
@@ -0,0 +1,175 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
6
|
+
|
7
|
+
<title>module YMDP::Compiler::Template - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<link type="text/css" media="screen" href="../../rdoc.css" rel="stylesheet">
|
10
|
+
|
11
|
+
<script type="text/javascript">
|
12
|
+
var rdoc_rel_prefix = "../../";
|
13
|
+
</script>
|
14
|
+
|
15
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
16
|
+
<script type="text/javascript" charset="utf-8" src="../../js/navigation.js"></script>
|
17
|
+
<script type="text/javascript" charset="utf-8" src="../../js/search_index.js"></script>
|
18
|
+
<script type="text/javascript" charset="utf-8" src="../../js/search.js"></script>
|
19
|
+
<script type="text/javascript" charset="utf-8" src="../../js/searcher.js"></script>
|
20
|
+
<script type="text/javascript" charset="utf-8" src="../../js/darkfish.js"></script>
|
21
|
+
|
22
|
+
|
23
|
+
<body id="top" class="module">
|
24
|
+
<nav id="metadata">
|
25
|
+
<nav id="home-section" class="section">
|
26
|
+
<h3 class="section-header">
|
27
|
+
<a href="../../index.html">Home</a>
|
28
|
+
<a href="../../table_of_contents.html#classes">Classes</a>
|
29
|
+
<a href="../../table_of_contents.html#methods">Methods</a>
|
30
|
+
</h3>
|
31
|
+
</nav>
|
32
|
+
|
33
|
+
|
34
|
+
<nav id="search-section" class="section project-section" class="initially-hidden">
|
35
|
+
<form action="#" method="get" accept-charset="utf-8">
|
36
|
+
<h3 class="section-header">
|
37
|
+
<input type="text" name="search" placeholder="Search" id="search-field"
|
38
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
39
|
+
</h3>
|
40
|
+
</form>
|
41
|
+
|
42
|
+
<ul id="search-results" class="initially-hidden"></ul>
|
43
|
+
</nav>
|
44
|
+
|
45
|
+
|
46
|
+
<div id="file-metadata">
|
47
|
+
<nav id="file-list-section" class="section">
|
48
|
+
<h3 class="section-header">Defined In</h3>
|
49
|
+
<ul>
|
50
|
+
<li>lib/ymdp/compiler/template.rb
|
51
|
+
</ul>
|
52
|
+
</nav>
|
53
|
+
|
54
|
+
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<div id="class-metadata">
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<div id="project-metadata">
|
65
|
+
<nav id="fileindex-section" class="section project-section">
|
66
|
+
<h3 class="section-header">Pages</h3>
|
67
|
+
|
68
|
+
<ul>
|
69
|
+
|
70
|
+
<li class="file"><a href="../../LICENSE.html">LICENSE</a>
|
71
|
+
|
72
|
+
<li class="file"><a href="../../README_rdoc.html">README</a>
|
73
|
+
|
74
|
+
</ul>
|
75
|
+
</nav>
|
76
|
+
|
77
|
+
<nav id="classindex-section" class="section project-section">
|
78
|
+
<h3 class="section-header">Class and Module Index</h3>
|
79
|
+
|
80
|
+
<ul class="link-list">
|
81
|
+
|
82
|
+
<li><a href="../../YMDP.html">YMDP</a>
|
83
|
+
|
84
|
+
<li><a href="../../YMDP/ApplicationView.html">YMDP::ApplicationView</a>
|
85
|
+
|
86
|
+
<li><a href="../../YMDP/AssetTagHelper.html">YMDP::AssetTagHelper</a>
|
87
|
+
|
88
|
+
<li><a href="../../YMDP/Base.html">YMDP::Base</a>
|
89
|
+
|
90
|
+
<li><a href="../../YMDP/Compiler.html">YMDP::Compiler</a>
|
91
|
+
|
92
|
+
<li><a href="../../YMDP/Compiler/Base.html">YMDP::Compiler::Base</a>
|
93
|
+
|
94
|
+
<li><a href="../../YMDP/Compiler/Domains.html">YMDP::Compiler::Domains</a>
|
95
|
+
|
96
|
+
<li><a href="../../YMDP/Compiler/Options.html">YMDP::Compiler::Options</a>
|
97
|
+
|
98
|
+
<li><a href="../../YMDP/Compiler/Template.html">YMDP::Compiler::Template</a>
|
99
|
+
|
100
|
+
<li><a href="../../YMDP/Compiler/Template/Base.html">YMDP::Compiler::Template::Base</a>
|
101
|
+
|
102
|
+
<li><a href="../../YMDP/Compiler/Template/CoffeeScript.html">YMDP::Compiler::Template::CoffeeScript</a>
|
103
|
+
|
104
|
+
<li><a href="../../YMDP/Compiler/Template/JavaScript.html">YMDP::Compiler::Template::JavaScript</a>
|
105
|
+
|
106
|
+
<li><a href="../../YMDP/Compiler/Template/View.html">YMDP::Compiler::Template::View</a>
|
107
|
+
|
108
|
+
<li><a href="../../YMDP/Compiler/Template/YRB.html">YMDP::Compiler::Template::YRB</a>
|
109
|
+
|
110
|
+
<li><a href="../../YMDP/Configuration.html">YMDP::Configuration</a>
|
111
|
+
|
112
|
+
<li><a href="../../YMDP/Configuration/Base.html">YMDP::Configuration::Base</a>
|
113
|
+
|
114
|
+
<li><a href="../../YMDP/Configuration/Config.html">YMDP::Configuration::Config</a>
|
115
|
+
|
116
|
+
<li><a href="../../YMDP/Configuration/Servers.html">YMDP::Configuration::Servers</a>
|
117
|
+
|
118
|
+
<li><a href="../../YMDP/Configuration/Setter.html">YMDP::Configuration::Setter</a>
|
119
|
+
|
120
|
+
<li><a href="../../YMDP/FormTagHelper.html">YMDP::FormTagHelper</a>
|
121
|
+
|
122
|
+
<li><a href="../../YMDP/GitHelper.html">YMDP::GitHelper</a>
|
123
|
+
|
124
|
+
<li><a href="../../YMDP/LinkTagHelper.html">YMDP::LinkTagHelper</a>
|
125
|
+
|
126
|
+
<li><a href="../../YMDP/View.html">YMDP::View</a>
|
127
|
+
|
128
|
+
<li><a href="../../ActionView.html">ActionView</a>
|
129
|
+
|
130
|
+
<li><a href="../../ActionView/Helpers.html">ActionView::Helpers</a>
|
131
|
+
|
132
|
+
<li><a href="../../ActionView/Helpers/TagHelper.html">ActionView::Helpers::TagHelper</a>
|
133
|
+
|
134
|
+
<li><a href="../../Application.html">Application</a>
|
135
|
+
|
136
|
+
<li><a href="../../Object.html">Object</a>
|
137
|
+
|
138
|
+
</ul>
|
139
|
+
</nav>
|
140
|
+
|
141
|
+
</div>
|
142
|
+
</nav>
|
143
|
+
|
144
|
+
<div id="documentation">
|
145
|
+
<h1 class="module">module YMDP::Compiler::Template</h1>
|
146
|
+
|
147
|
+
<div id="description" class="description">
|
148
|
+
|
149
|
+
</div><!-- description -->
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
<!-- Methods -->
|
164
|
+
|
165
|
+
</section><!-- 5Buntitled-5D -->
|
166
|
+
|
167
|
+
</div><!-- documentation -->
|
168
|
+
|
169
|
+
|
170
|
+
<footer id="validator-badges">
|
171
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
172
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
|
173
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
174
|
+
</footer>
|
175
|
+
|
@@ -0,0 +1,911 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
6
|
+
|
7
|
+
<title>class YMDP::Compiler::Template::Base - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<link type="text/css" media="screen" href="../../../rdoc.css" rel="stylesheet">
|
10
|
+
|
11
|
+
<script type="text/javascript">
|
12
|
+
var rdoc_rel_prefix = "../../../";
|
13
|
+
</script>
|
14
|
+
|
15
|
+
<script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
|
16
|
+
<script type="text/javascript" charset="utf-8" src="../../../js/navigation.js"></script>
|
17
|
+
<script type="text/javascript" charset="utf-8" src="../../../js/search_index.js"></script>
|
18
|
+
<script type="text/javascript" charset="utf-8" src="../../../js/search.js"></script>
|
19
|
+
<script type="text/javascript" charset="utf-8" src="../../../js/searcher.js"></script>
|
20
|
+
<script type="text/javascript" charset="utf-8" src="../../../js/darkfish.js"></script>
|
21
|
+
|
22
|
+
|
23
|
+
<body id="top" class="class">
|
24
|
+
<nav id="metadata">
|
25
|
+
<nav id="home-section" class="section">
|
26
|
+
<h3 class="section-header">
|
27
|
+
<a href="../../../index.html">Home</a>
|
28
|
+
<a href="../../../table_of_contents.html#classes">Classes</a>
|
29
|
+
<a href="../../../table_of_contents.html#methods">Methods</a>
|
30
|
+
</h3>
|
31
|
+
</nav>
|
32
|
+
|
33
|
+
|
34
|
+
<nav id="search-section" class="section project-section" class="initially-hidden">
|
35
|
+
<form action="#" method="get" accept-charset="utf-8">
|
36
|
+
<h3 class="section-header">
|
37
|
+
<input type="text" name="search" placeholder="Search" id="search-field"
|
38
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
39
|
+
</h3>
|
40
|
+
</form>
|
41
|
+
|
42
|
+
<ul id="search-results" class="initially-hidden"></ul>
|
43
|
+
</nav>
|
44
|
+
|
45
|
+
|
46
|
+
<div id="file-metadata">
|
47
|
+
<nav id="file-list-section" class="section">
|
48
|
+
<h3 class="section-header">Defined In</h3>
|
49
|
+
<ul>
|
50
|
+
<li>lib/ymdp/compiler/template.rb
|
51
|
+
</ul>
|
52
|
+
</nav>
|
53
|
+
|
54
|
+
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<div id="class-metadata">
|
58
|
+
|
59
|
+
<nav id="parent-class-section" class="section">
|
60
|
+
<h3 class="section-header">Parent</h3>
|
61
|
+
|
62
|
+
<p class="link"><a href="../../Base.html">YMDP::Base</a>
|
63
|
+
|
64
|
+
</nav>
|
65
|
+
|
66
|
+
|
67
|
+
<!-- Method Quickref -->
|
68
|
+
<nav id="method-list-section" class="section">
|
69
|
+
<h3 class="section-header">Methods</h3>
|
70
|
+
|
71
|
+
<ul class="link-list">
|
72
|
+
|
73
|
+
<li><a href="#method-c-new">::new</a>
|
74
|
+
|
75
|
+
<li><a href="#method-i-base_filename">#base_filename</a>
|
76
|
+
|
77
|
+
<li><a href="#method-i-build">#build</a>
|
78
|
+
|
79
|
+
<li><a href="#method-i-destination_path">#destination_path</a>
|
80
|
+
|
81
|
+
<li><a href="#method-i-partial-3F">#partial?</a>
|
82
|
+
|
83
|
+
<li><a href="#method-i-process_template">#process_template</a>
|
84
|
+
|
85
|
+
<li><a href="#method-i-processed_template">#processed_template</a>
|
86
|
+
|
87
|
+
<li><a href="#method-i-server_path">#server_path</a>
|
88
|
+
|
89
|
+
<li><a href="#method-i-servers_path">#servers_path</a>
|
90
|
+
|
91
|
+
<li><a href="#method-i-set_content_variables">#set_content_variables</a>
|
92
|
+
|
93
|
+
<li><a href="#method-i-verbose">#verbose</a>
|
94
|
+
|
95
|
+
<li><a href="#method-i-verbose-3F">#verbose?</a>
|
96
|
+
|
97
|
+
<li><a href="#method-i-write_template">#write_template</a>
|
98
|
+
|
99
|
+
<li><a href="#method-i-write_template_with_layout">#write_template_with_layout</a>
|
100
|
+
|
101
|
+
<li><a href="#method-i-write_template_without_layout">#write_template_without_layout</a>
|
102
|
+
|
103
|
+
</ul>
|
104
|
+
</nav>
|
105
|
+
|
106
|
+
</div>
|
107
|
+
|
108
|
+
<div id="project-metadata">
|
109
|
+
<nav id="fileindex-section" class="section project-section">
|
110
|
+
<h3 class="section-header">Pages</h3>
|
111
|
+
|
112
|
+
<ul>
|
113
|
+
|
114
|
+
<li class="file"><a href="../../../LICENSE.html">LICENSE</a>
|
115
|
+
|
116
|
+
<li class="file"><a href="../../../README_rdoc.html">README</a>
|
117
|
+
|
118
|
+
</ul>
|
119
|
+
</nav>
|
120
|
+
|
121
|
+
<nav id="classindex-section" class="section project-section">
|
122
|
+
<h3 class="section-header">Class and Module Index</h3>
|
123
|
+
|
124
|
+
<ul class="link-list">
|
125
|
+
|
126
|
+
<li><a href="../../../YMDP.html">YMDP</a>
|
127
|
+
|
128
|
+
<li><a href="../../../YMDP/ApplicationView.html">YMDP::ApplicationView</a>
|
129
|
+
|
130
|
+
<li><a href="../../../YMDP/AssetTagHelper.html">YMDP::AssetTagHelper</a>
|
131
|
+
|
132
|
+
<li><a href="../../../YMDP/Base.html">YMDP::Base</a>
|
133
|
+
|
134
|
+
<li><a href="../../../YMDP/Compiler.html">YMDP::Compiler</a>
|
135
|
+
|
136
|
+
<li><a href="../../../YMDP/Compiler/Base.html">YMDP::Compiler::Base</a>
|
137
|
+
|
138
|
+
<li><a href="../../../YMDP/Compiler/Domains.html">YMDP::Compiler::Domains</a>
|
139
|
+
|
140
|
+
<li><a href="../../../YMDP/Compiler/Options.html">YMDP::Compiler::Options</a>
|
141
|
+
|
142
|
+
<li><a href="../../../YMDP/Compiler/Template.html">YMDP::Compiler::Template</a>
|
143
|
+
|
144
|
+
<li><a href="../../../YMDP/Compiler/Template/Base.html">YMDP::Compiler::Template::Base</a>
|
145
|
+
|
146
|
+
<li><a href="../../../YMDP/Compiler/Template/CoffeeScript.html">YMDP::Compiler::Template::CoffeeScript</a>
|
147
|
+
|
148
|
+
<li><a href="../../../YMDP/Compiler/Template/JavaScript.html">YMDP::Compiler::Template::JavaScript</a>
|
149
|
+
|
150
|
+
<li><a href="../../../YMDP/Compiler/Template/View.html">YMDP::Compiler::Template::View</a>
|
151
|
+
|
152
|
+
<li><a href="../../../YMDP/Compiler/Template/YRB.html">YMDP::Compiler::Template::YRB</a>
|
153
|
+
|
154
|
+
<li><a href="../../../YMDP/Configuration.html">YMDP::Configuration</a>
|
155
|
+
|
156
|
+
<li><a href="../../../YMDP/Configuration/Base.html">YMDP::Configuration::Base</a>
|
157
|
+
|
158
|
+
<li><a href="../../../YMDP/Configuration/Config.html">YMDP::Configuration::Config</a>
|
159
|
+
|
160
|
+
<li><a href="../../../YMDP/Configuration/Servers.html">YMDP::Configuration::Servers</a>
|
161
|
+
|
162
|
+
<li><a href="../../../YMDP/Configuration/Setter.html">YMDP::Configuration::Setter</a>
|
163
|
+
|
164
|
+
<li><a href="../../../YMDP/FormTagHelper.html">YMDP::FormTagHelper</a>
|
165
|
+
|
166
|
+
<li><a href="../../../YMDP/GitHelper.html">YMDP::GitHelper</a>
|
167
|
+
|
168
|
+
<li><a href="../../../YMDP/LinkTagHelper.html">YMDP::LinkTagHelper</a>
|
169
|
+
|
170
|
+
<li><a href="../../../YMDP/View.html">YMDP::View</a>
|
171
|
+
|
172
|
+
<li><a href="../../../ActionView.html">ActionView</a>
|
173
|
+
|
174
|
+
<li><a href="../../../ActionView/Helpers.html">ActionView::Helpers</a>
|
175
|
+
|
176
|
+
<li><a href="../../../ActionView/Helpers/TagHelper.html">ActionView::Helpers::TagHelper</a>
|
177
|
+
|
178
|
+
<li><a href="../../../Application.html">Application</a>
|
179
|
+
|
180
|
+
<li><a href="../../../Object.html">Object</a>
|
181
|
+
|
182
|
+
</ul>
|
183
|
+
</nav>
|
184
|
+
|
185
|
+
</div>
|
186
|
+
</nav>
|
187
|
+
|
188
|
+
<div id="documentation">
|
189
|
+
<h1 class="class">class YMDP::Compiler::Template::Base</h1>
|
190
|
+
|
191
|
+
<div id="description" class="description">
|
192
|
+
|
193
|
+
<p>Process source files into usable code.</p>
|
194
|
+
|
195
|
+
<p>Source files can be HTML, Haml, ERB, <a
|
196
|
+
href="JavaScript.html">JavaScript</a>, or CSS files.</p>
|
197
|
+
|
198
|
+
<p>Files with an extension of “.haml” will be processed with Haml, all
|
199
|
+
others will use ERB.</p>
|
200
|
+
|
201
|
+
<h3 id="label-Examples">Examples</h3>
|
202
|
+
|
203
|
+
<pre>YMDP::Compiler::Template::View.new(params).build
|
204
|
+
|
205
|
+
YMDP::Compiler::Template::JavaScript.new(params).build
|
206
|
+
|
207
|
+
@template = YMDP::Compiler::Template::Base.new(params)</pre>
|
208
|
+
|
209
|
+
<h3 id="label-Options"><a href="../Options.html">Options</a></h3>
|
210
|
+
|
211
|
+
<pre>verbose:: boolean value, output verbose notices,
|
212
|
+
domain:: string, indicates which domain the template is compiling to,
|
213
|
+
file:: filename of the template in question,
|
214
|
+
hash:: git hash of the latest commit,
|
215
|
+
message:: commit message of the latest commit.</pre>
|
216
|
+
|
217
|
+
</div><!-- description -->
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
|
230
|
+
<!-- Attributes -->
|
231
|
+
<section id="attribute-method-details" class="method-section section">
|
232
|
+
<h3 class="section-header">Attributes</h3>
|
233
|
+
|
234
|
+
|
235
|
+
<div id="attribute-i-assets_directory" class="method-detail">
|
236
|
+
<div class="method-heading attribute-method-heading">
|
237
|
+
<span class="method-name">assets_directory</span><span
|
238
|
+
class="attribute-access-type">[RW]</span>
|
239
|
+
</div>
|
240
|
+
|
241
|
+
<div class="method-description">
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
</div>
|
246
|
+
</div>
|
247
|
+
|
248
|
+
<div id="attribute-i-domain" class="method-detail">
|
249
|
+
<div class="method-heading attribute-method-heading">
|
250
|
+
<span class="method-name">domain</span><span
|
251
|
+
class="attribute-access-type">[RW]</span>
|
252
|
+
</div>
|
253
|
+
|
254
|
+
<div class="method-description">
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
</div>
|
259
|
+
</div>
|
260
|
+
|
261
|
+
<div id="attribute-i-file" class="method-detail">
|
262
|
+
<div class="method-heading attribute-method-heading">
|
263
|
+
<span class="method-name">file</span><span
|
264
|
+
class="attribute-access-type">[RW]</span>
|
265
|
+
</div>
|
266
|
+
|
267
|
+
<div class="method-description">
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
</div>
|
272
|
+
</div>
|
273
|
+
|
274
|
+
<div id="attribute-i-hash" class="method-detail">
|
275
|
+
<div class="method-heading attribute-method-heading">
|
276
|
+
<span class="method-name">hash</span><span
|
277
|
+
class="attribute-access-type">[RW]</span>
|
278
|
+
</div>
|
279
|
+
|
280
|
+
<div class="method-description">
|
281
|
+
|
282
|
+
|
283
|
+
|
284
|
+
</div>
|
285
|
+
</div>
|
286
|
+
|
287
|
+
<div id="attribute-i-host" class="method-detail">
|
288
|
+
<div class="method-heading attribute-method-heading">
|
289
|
+
<span class="method-name">host</span><span
|
290
|
+
class="attribute-access-type">[RW]</span>
|
291
|
+
</div>
|
292
|
+
|
293
|
+
<div class="method-description">
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
</div>
|
298
|
+
</div>
|
299
|
+
|
300
|
+
<div id="attribute-i-message" class="method-detail">
|
301
|
+
<div class="method-heading attribute-method-heading">
|
302
|
+
<span class="method-name">message</span><span
|
303
|
+
class="attribute-access-type">[RW]</span>
|
304
|
+
</div>
|
305
|
+
|
306
|
+
<div class="method-description">
|
307
|
+
|
308
|
+
|
309
|
+
|
310
|
+
</div>
|
311
|
+
</div>
|
312
|
+
|
313
|
+
<div id="attribute-i-server" class="method-detail">
|
314
|
+
<div class="method-heading attribute-method-heading">
|
315
|
+
<span class="method-name">server</span><span
|
316
|
+
class="attribute-access-type">[RW]</span>
|
317
|
+
</div>
|
318
|
+
|
319
|
+
<div class="method-description">
|
320
|
+
|
321
|
+
|
322
|
+
|
323
|
+
</div>
|
324
|
+
</div>
|
325
|
+
|
326
|
+
</section><!-- attribute-method-details -->
|
327
|
+
|
328
|
+
|
329
|
+
<!-- Methods -->
|
330
|
+
|
331
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section section">
|
332
|
+
<h3 class="section-header">Public Class Methods</h3>
|
333
|
+
|
334
|
+
|
335
|
+
<div id="method-c-new" class="method-detail ">
|
336
|
+
|
337
|
+
<div class="method-heading">
|
338
|
+
<span class="method-name">new</span><span
|
339
|
+
class="method-args">(params)</span>
|
340
|
+
<span class="method-click-advice">click to toggle source</span>
|
341
|
+
</div>
|
342
|
+
|
343
|
+
|
344
|
+
<div class="method-description">
|
345
|
+
|
346
|
+
|
347
|
+
|
348
|
+
|
349
|
+
|
350
|
+
<div class="method-source-code" id="new-source">
|
351
|
+
<pre><span class="ruby-comment"># File lib/ymdp/compiler/template.rb, line 34</span>
|
352
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">params</span>)
|
353
|
+
<span class="ruby-ivar">@verbose</span> = <span class="ruby-identifier">params</span>[<span class="ruby-value">:verbose</span>]
|
354
|
+
<span class="ruby-ivar">@domain</span> = <span class="ruby-identifier">params</span>[<span class="ruby-value">:domain</span>]
|
355
|
+
<span class="ruby-ivar">@host</span> = <span class="ruby-identifier">params</span>[<span class="ruby-value">:host</span>]
|
356
|
+
|
357
|
+
<span class="ruby-identifier">server_settings</span> = <span class="ruby-identifier">servers</span>[<span class="ruby-ivar">@domain</span>]
|
358
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">server_settings</span>
|
359
|
+
<span class="ruby-ivar">@server</span> = <span class="ruby-identifier">server_settings</span>[<span class="ruby-string">"server"</span>]
|
360
|
+
<span class="ruby-keyword">else</span>
|
361
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">StandardError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">"Server settings are required."</span>)
|
362
|
+
<span class="ruby-keyword">end</span>
|
363
|
+
|
364
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">StandardError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">"Server name does not exist in server settings."</span>) <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@server</span>
|
365
|
+
|
366
|
+
<span class="ruby-ivar">@file</span> = <span class="ruby-identifier">params</span>[<span class="ruby-value">:file</span>]
|
367
|
+
<span class="ruby-ivar">@assets_directory</span> = <span class="ruby-string">"/yahoo/mail/assets"</span>
|
368
|
+
<span class="ruby-ivar">@assets_url</span> = <span class="ruby-node">"http://#{servers[@domain]['application_id']}.yom.mail.yahoo.net#{@assets_directory}"</span>
|
369
|
+
<span class="ruby-ivar">@hash</span> = <span class="ruby-identifier">params</span>[<span class="ruby-value">:git_hash</span>]
|
370
|
+
<span class="ruby-ivar">@message</span> = <span class="ruby-identifier">params</span>[<span class="ruby-value">:message</span>]
|
371
|
+
|
372
|
+
<span class="ruby-identifier">set_content_variables</span>
|
373
|
+
|
374
|
+
<span class="ruby-ivar">@view</span> = <span class="ruby-identifier">base_filename</span>(<span class="ruby-ivar">@file</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">"/"</span>).<span class="ruby-identifier">last</span>)
|
375
|
+
<span class="ruby-constant">Application</span>.<span class="ruby-identifier">current_view</span> = <span class="ruby-ivar">@view</span>
|
376
|
+
<span class="ruby-keyword">end</span></pre>
|
377
|
+
</div><!-- new-source -->
|
378
|
+
|
379
|
+
</div>
|
380
|
+
|
381
|
+
|
382
|
+
|
383
|
+
|
384
|
+
</div><!-- new-method -->
|
385
|
+
|
386
|
+
|
387
|
+
</section><!-- public-class-method-details -->
|
388
|
+
|
389
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
|
390
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
391
|
+
|
392
|
+
|
393
|
+
<div id="method-i-base_filename" class="method-detail ">
|
394
|
+
|
395
|
+
<div class="method-heading">
|
396
|
+
<span class="method-name">base_filename</span><span
|
397
|
+
class="method-args">(filename)</span>
|
398
|
+
<span class="method-click-advice">click to toggle source</span>
|
399
|
+
</div>
|
400
|
+
|
401
|
+
|
402
|
+
<div class="method-description">
|
403
|
+
|
404
|
+
|
405
|
+
|
406
|
+
|
407
|
+
|
408
|
+
<div class="method-source-code" id="base_filename-source">
|
409
|
+
<pre><span class="ruby-comment"># File lib/ymdp/compiler/template.rb, line 108</span>
|
410
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">base_filename</span>(<span class="ruby-identifier">filename</span>)
|
411
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-string">"Define in child"</span>
|
412
|
+
<span class="ruby-keyword">end</span></pre>
|
413
|
+
</div><!-- base_filename-source -->
|
414
|
+
|
415
|
+
</div>
|
416
|
+
|
417
|
+
|
418
|
+
|
419
|
+
|
420
|
+
</div><!-- base_filename-method -->
|
421
|
+
|
422
|
+
|
423
|
+
<div id="method-i-build" class="method-detail ">
|
424
|
+
|
425
|
+
<div class="method-heading">
|
426
|
+
<span class="method-name">build</span><span
|
427
|
+
class="method-args">()</span>
|
428
|
+
<span class="method-click-advice">click to toggle source</span>
|
429
|
+
</div>
|
430
|
+
|
431
|
+
|
432
|
+
<div class="method-description">
|
433
|
+
|
434
|
+
<p>Compile this view unless it is a partial.</p>
|
435
|
+
|
436
|
+
|
437
|
+
|
438
|
+
<div class="method-source-code" id="build-source">
|
439
|
+
<pre><span class="ruby-comment"># File lib/ymdp/compiler/template.rb, line 87</span>
|
440
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">build</span>
|
441
|
+
<span class="ruby-comment"># puts "Base build"</span>
|
442
|
+
<span class="ruby-keyword">unless</span> <span class="ruby-identifier">partial?</span>
|
443
|
+
<span class="ruby-identifier">write_template</span>(<span class="ruby-identifier">processed_template</span>)
|
444
|
+
<span class="ruby-keyword">end</span>
|
445
|
+
<span class="ruby-keyword">end</span></pre>
|
446
|
+
</div><!-- build-source -->
|
447
|
+
|
448
|
+
</div>
|
449
|
+
|
450
|
+
|
451
|
+
|
452
|
+
|
453
|
+
</div><!-- build-method -->
|
454
|
+
|
455
|
+
|
456
|
+
<div id="method-i-destination_path" class="method-detail ">
|
457
|
+
|
458
|
+
<div class="method-heading">
|
459
|
+
<span class="method-name">destination_path</span><span
|
460
|
+
class="method-args">()</span>
|
461
|
+
<span class="method-click-advice">click to toggle source</span>
|
462
|
+
</div>
|
463
|
+
|
464
|
+
|
465
|
+
<div class="method-description">
|
466
|
+
|
467
|
+
<p>Produces the destination path of this template, in the servers directory
|
468
|
+
for the given domain.</p>
|
469
|
+
|
470
|
+
<h3 id="method-i-destination_path-label-Examples">Examples</h3>
|
471
|
+
|
472
|
+
<p>If the source file is:</p>
|
473
|
+
|
474
|
+
<pre>app/views/authorize.html.haml</pre>
|
475
|
+
|
476
|
+
<p>The destination file will be:</p>
|
477
|
+
|
478
|
+
<pre>servers/staging/views/authorize.html.haml</pre>
|
479
|
+
|
480
|
+
|
481
|
+
|
482
|
+
<div class="method-source-code" id="destination_path-source">
|
483
|
+
<pre><span class="ruby-comment"># File lib/ymdp/compiler/template.rb, line 131</span>
|
484
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">destination_path</span>
|
485
|
+
<span class="ruby-comment"># just the file, with no directory</span>
|
486
|
+
<span class="ruby-identifier">filename</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-ivar">@file</span>)
|
487
|
+
|
488
|
+
<span class="ruby-comment"># just the filename, with no extension</span>
|
489
|
+
<span class="ruby-identifier">filename</span> = <span class="ruby-identifier">convert_filename</span>(<span class="ruby-identifier">filename</span>)
|
490
|
+
|
491
|
+
<span class="ruby-comment"># just the directory, with no file </span>
|
492
|
+
<span class="ruby-identifier">directory</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-ivar">@file</span>)
|
493
|
+
|
494
|
+
<span class="ruby-comment"># replace the app directory with the server directory</span>
|
495
|
+
<span class="ruby-identifier">relative_directory</span> = <span class="ruby-identifier">directory</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-node">"#{paths[:base_path]}/app"</span>, <span class="ruby-identifier">server_path</span>)
|
496
|
+
|
497
|
+
<span class="ruby-comment"># make the directory if it doesn't exist</span>
|
498
|
+
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>(<span class="ruby-identifier">relative_directory</span>)
|
499
|
+
|
500
|
+
<span class="ruby-node">"#{relative_directory}/#{filename}"</span>
|
501
|
+
<span class="ruby-keyword">end</span></pre>
|
502
|
+
</div><!-- destination_path-source -->
|
503
|
+
|
504
|
+
</div>
|
505
|
+
|
506
|
+
|
507
|
+
|
508
|
+
|
509
|
+
</div><!-- destination_path-method -->
|
510
|
+
|
511
|
+
|
512
|
+
<div id="method-i-partial-3F" class="method-detail ">
|
513
|
+
|
514
|
+
<div class="method-heading">
|
515
|
+
<span class="method-name">partial?</span><span
|
516
|
+
class="method-args">()</span>
|
517
|
+
<span class="method-click-advice">click to toggle source</span>
|
518
|
+
</div>
|
519
|
+
|
520
|
+
|
521
|
+
<div class="method-description">
|
522
|
+
|
523
|
+
<p>If the filename begins with a <code>_</code> it’s a partial.</p>
|
524
|
+
|
525
|
+
|
526
|
+
|
527
|
+
<div class="method-source-code" id="partial-3F-source">
|
528
|
+
<pre><span class="ruby-comment"># File lib/ymdp/compiler/template.rb, line 81</span>
|
529
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">partial?</span>
|
530
|
+
<span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-ivar">@file</span>) <span class="ruby-operator">=~</span> <span class="ruby-regexp">%r^_/</span>
|
531
|
+
<span class="ruby-keyword">end</span></pre>
|
532
|
+
</div><!-- partial-3F-source -->
|
533
|
+
|
534
|
+
</div>
|
535
|
+
|
536
|
+
|
537
|
+
|
538
|
+
|
539
|
+
</div><!-- partial-3F-method -->
|
540
|
+
|
541
|
+
|
542
|
+
<div id="method-i-process_template" class="method-detail ">
|
543
|
+
|
544
|
+
<div class="method-heading">
|
545
|
+
<span class="method-name">process_template</span><span
|
546
|
+
class="method-args">(template)</span>
|
547
|
+
<span class="method-click-advice">click to toggle source</span>
|
548
|
+
</div>
|
549
|
+
|
550
|
+
|
551
|
+
<div class="method-description">
|
552
|
+
|
553
|
+
<p>Implemented in child classes, this defines what must be done to process a
|
554
|
+
template.</p>
|
555
|
+
|
556
|
+
|
557
|
+
|
558
|
+
<div class="method-source-code" id="process_template-source">
|
559
|
+
<pre><span class="ruby-comment"># File lib/ymdp/compiler/template.rb, line 114</span>
|
560
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">process_template</span>(<span class="ruby-identifier">template</span>)
|
561
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-string">"Define in child"</span>
|
562
|
+
<span class="ruby-keyword">end</span></pre>
|
563
|
+
</div><!-- process_template-source -->
|
564
|
+
|
565
|
+
</div>
|
566
|
+
|
567
|
+
|
568
|
+
|
569
|
+
|
570
|
+
</div><!-- process_template-method -->
|
571
|
+
|
572
|
+
|
573
|
+
<div id="method-i-processed_template" class="method-detail ">
|
574
|
+
|
575
|
+
<div class="method-heading">
|
576
|
+
<span class="method-name">processed_template</span><span
|
577
|
+
class="method-args">()</span>
|
578
|
+
<span class="method-click-advice">click to toggle source</span>
|
579
|
+
</div>
|
580
|
+
|
581
|
+
|
582
|
+
<div class="method-description">
|
583
|
+
|
584
|
+
<p>Returns the compiled template code after its Haml or ERB has been
|
585
|
+
processed.</p>
|
586
|
+
|
587
|
+
|
588
|
+
|
589
|
+
<div class="method-source-code" id="processed_template-source">
|
590
|
+
<pre><span class="ruby-comment"># File lib/ymdp/compiler/template.rb, line 96</span>
|
591
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">processed_template</span>
|
592
|
+
<span class="ruby-comment"># "Base processed_template"</span>
|
593
|
+
<span class="ruby-identifier">result</span> = <span class="ruby-string">""</span>
|
594
|
+
<span class="ruby-identifier">template</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-ivar">@file</span>)
|
595
|
+
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@file</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">%r\.haml$/</span>
|
596
|
+
<span class="ruby-identifier">result</span> = <span class="ruby-identifier">process_haml</span>(<span class="ruby-identifier">template</span>, <span class="ruby-ivar">@file</span>)
|
597
|
+
<span class="ruby-keyword">else</span>
|
598
|
+
<span class="ruby-identifier">result</span> = <span class="ruby-identifier">process_template</span>(<span class="ruby-identifier">template</span>)
|
599
|
+
<span class="ruby-keyword">end</span>
|
600
|
+
<span class="ruby-identifier">result</span>
|
601
|
+
<span class="ruby-keyword">end</span></pre>
|
602
|
+
</div><!-- processed_template-source -->
|
603
|
+
|
604
|
+
</div>
|
605
|
+
|
606
|
+
|
607
|
+
|
608
|
+
|
609
|
+
</div><!-- processed_template-method -->
|
610
|
+
|
611
|
+
|
612
|
+
<div id="method-i-server_path" class="method-detail ">
|
613
|
+
|
614
|
+
<div class="method-heading">
|
615
|
+
<span class="method-name">server_path</span><span
|
616
|
+
class="method-args">()</span>
|
617
|
+
<span class="method-click-advice">click to toggle source</span>
|
618
|
+
</div>
|
619
|
+
|
620
|
+
|
621
|
+
<div class="method-description">
|
622
|
+
|
623
|
+
<p>Path to the servers directory for the current domain.</p>
|
624
|
+
|
625
|
+
|
626
|
+
|
627
|
+
<div class="method-source-code" id="server_path-source">
|
628
|
+
<pre><span class="ruby-comment"># File lib/ymdp/compiler/template.rb, line 152</span>
|
629
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">server_path</span>
|
630
|
+
<span class="ruby-node">"#{servers_path}/#{@domain}"</span>
|
631
|
+
<span class="ruby-keyword">end</span></pre>
|
632
|
+
</div><!-- server_path-source -->
|
633
|
+
|
634
|
+
</div>
|
635
|
+
|
636
|
+
|
637
|
+
|
638
|
+
|
639
|
+
</div><!-- server_path-method -->
|
640
|
+
|
641
|
+
|
642
|
+
<div id="method-i-servers_path" class="method-detail ">
|
643
|
+
|
644
|
+
<div class="method-heading">
|
645
|
+
<span class="method-name">servers_path</span><span
|
646
|
+
class="method-args">()</span>
|
647
|
+
<span class="method-click-advice">click to toggle source</span>
|
648
|
+
</div>
|
649
|
+
|
650
|
+
|
651
|
+
<div class="method-description">
|
652
|
+
|
653
|
+
|
654
|
+
|
655
|
+
|
656
|
+
|
657
|
+
<div class="method-source-code" id="servers_path-source">
|
658
|
+
<pre><span class="ruby-comment"># File lib/ymdp/compiler/template.rb, line 219</span>
|
659
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">servers_path</span>
|
660
|
+
<span class="ruby-node">"#{paths[:base_path]}/servers"</span>
|
661
|
+
<span class="ruby-keyword">end</span></pre>
|
662
|
+
</div><!-- servers_path-source -->
|
663
|
+
|
664
|
+
</div>
|
665
|
+
|
666
|
+
|
667
|
+
|
668
|
+
|
669
|
+
</div><!-- servers_path-method -->
|
670
|
+
|
671
|
+
|
672
|
+
<div id="method-i-set_content_variables" class="method-detail ">
|
673
|
+
|
674
|
+
<div class="method-heading">
|
675
|
+
<span class="method-name">set_content_variables</span><span
|
676
|
+
class="method-args">()</span>
|
677
|
+
<span class="method-click-advice">click to toggle source</span>
|
678
|
+
</div>
|
679
|
+
|
680
|
+
|
681
|
+
<div class="method-description">
|
682
|
+
|
683
|
+
<p>Parsed from the file ‘content.yml’ each of its keys is added to the
|
684
|
+
environment as an instance variable, so they will be available inside the
|
685
|
+
template.</p>
|
686
|
+
|
687
|
+
|
688
|
+
|
689
|
+
<div class="method-source-code" id="set_content_variables-source">
|
690
|
+
<pre><span class="ruby-comment"># File lib/ymdp/compiler/template.rb, line 69</span>
|
691
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">set_content_variables</span>
|
692
|
+
<span class="ruby-identifier">content_variables</span>.<span class="ruby-identifier">to_a</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
|
693
|
+
<span class="ruby-identifier">attribute</span> = <span class="ruby-node">"@#{key}"</span>
|
694
|
+
<span class="ruby-identifier">instance_variable_set</span>(<span class="ruby-identifier">attribute</span>, <span class="ruby-identifier">value</span>) <span class="ruby-keyword">unless</span> <span class="ruby-identifier">instance_variable_defined?</span>(<span class="ruby-identifier">attribute</span>)
|
695
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">class_eval</span> <span class="ruby-node">%Q(
|
696
|
+
attr_accessor :#{key}
|
697
|
+
)</span>
|
698
|
+
<span class="ruby-keyword">end</span>
|
699
|
+
<span class="ruby-keyword">end</span></pre>
|
700
|
+
</div><!-- set_content_variables-source -->
|
701
|
+
|
702
|
+
</div>
|
703
|
+
|
704
|
+
|
705
|
+
|
706
|
+
|
707
|
+
</div><!-- set_content_variables-method -->
|
708
|
+
|
709
|
+
|
710
|
+
<div id="method-i-verbose" class="method-detail ">
|
711
|
+
|
712
|
+
<div class="method-heading">
|
713
|
+
<span class="method-name">verbose</span><span
|
714
|
+
class="method-args">(message)</span>
|
715
|
+
<span class="method-click-advice">click to toggle source</span>
|
716
|
+
</div>
|
717
|
+
|
718
|
+
|
719
|
+
<div class="method-description">
|
720
|
+
|
721
|
+
<p>Outputs a message if @verbose is on.</p>
|
722
|
+
|
723
|
+
|
724
|
+
|
725
|
+
<div class="method-source-code" id="verbose-source">
|
726
|
+
<pre><span class="ruby-comment"># File lib/ymdp/compiler/template.rb, line 158</span>
|
727
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">verbose</span>(<span class="ruby-identifier">message</span>)
|
728
|
+
<span class="ruby-identifier">$stdout</span>.<span class="ruby-identifier">puts</span>(<span class="ruby-identifier">message</span>) <span class="ruby-keyword">if</span> <span class="ruby-ivar">@verbose</span>
|
729
|
+
<span class="ruby-keyword">end</span></pre>
|
730
|
+
</div><!-- verbose-source -->
|
731
|
+
|
732
|
+
</div>
|
733
|
+
|
734
|
+
|
735
|
+
|
736
|
+
|
737
|
+
</div><!-- verbose-method -->
|
738
|
+
|
739
|
+
|
740
|
+
<div id="method-i-verbose-3F" class="method-detail ">
|
741
|
+
|
742
|
+
<div class="method-heading">
|
743
|
+
<span class="method-name">verbose?</span><span
|
744
|
+
class="method-args">()</span>
|
745
|
+
<span class="method-click-advice">click to toggle source</span>
|
746
|
+
</div>
|
747
|
+
|
748
|
+
|
749
|
+
<div class="method-description">
|
750
|
+
|
751
|
+
<p>Is the verbose setting on?</p>
|
752
|
+
|
753
|
+
|
754
|
+
|
755
|
+
<div class="method-source-code" id="verbose-3F-source">
|
756
|
+
<pre><span class="ruby-comment"># File lib/ymdp/compiler/template.rb, line 62</span>
|
757
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">verbose?</span>
|
758
|
+
<span class="ruby-ivar">@verbose</span>
|
759
|
+
<span class="ruby-keyword">end</span></pre>
|
760
|
+
</div><!-- verbose-3F-source -->
|
761
|
+
|
762
|
+
</div>
|
763
|
+
|
764
|
+
|
765
|
+
|
766
|
+
|
767
|
+
</div><!-- verbose-3F-method -->
|
768
|
+
|
769
|
+
|
770
|
+
<div id="method-i-write_template" class="method-detail ">
|
771
|
+
|
772
|
+
<div class="method-heading">
|
773
|
+
<span class="method-name">write_template</span><span
|
774
|
+
class="method-args">(result)</span>
|
775
|
+
<span class="method-click-advice">click to toggle source</span>
|
776
|
+
</div>
|
777
|
+
|
778
|
+
|
779
|
+
<div class="method-description">
|
780
|
+
|
781
|
+
<p>Write this processed template to its destination file.</p>
|
782
|
+
|
783
|
+
<p>Overwrite this method in child class to define whether the class uses a
|
784
|
+
template or not.</p>
|
785
|
+
|
786
|
+
|
787
|
+
|
788
|
+
<div class="method-source-code" id="write_template-source">
|
789
|
+
<pre><span class="ruby-comment"># File lib/ymdp/compiler/template.rb, line 214</span>
|
790
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">write_template</span>(<span class="ruby-identifier">result</span>)
|
791
|
+
<span class="ruby-comment"># puts "Base write_template"</span>
|
792
|
+
<span class="ruby-identifier">write_template_with_layout</span>(<span class="ruby-identifier">result</span>)
|
793
|
+
<span class="ruby-keyword">end</span></pre>
|
794
|
+
</div><!-- write_template-source -->
|
795
|
+
|
796
|
+
</div>
|
797
|
+
|
798
|
+
|
799
|
+
|
800
|
+
|
801
|
+
</div><!-- write_template-method -->
|
802
|
+
|
803
|
+
|
804
|
+
<div id="method-i-write_template_with_layout" class="method-detail ">
|
805
|
+
|
806
|
+
<div class="method-heading">
|
807
|
+
<span class="method-name">write_template_with_layout</span><span
|
808
|
+
class="method-args">(result)</span>
|
809
|
+
<span class="method-click-advice">click to toggle source</span>
|
810
|
+
</div>
|
811
|
+
|
812
|
+
|
813
|
+
<div class="method-description">
|
814
|
+
|
815
|
+
<p>Writes the input string to the destination file, passing it through the
|
816
|
+
application template.</p>
|
817
|
+
|
818
|
+
<p>The application layout can be either Haml or ERB.</p>
|
819
|
+
|
820
|
+
|
821
|
+
|
822
|
+
<div class="method-source-code" id="write_template_with_layout-source">
|
823
|
+
<pre><span class="ruby-comment"># File lib/ymdp/compiler/template.rb, line 182</span>
|
824
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">write_template_with_layout</span>(<span class="ruby-identifier">result</span>)
|
825
|
+
<span class="ruby-comment"># puts "Base write_template_with_layout"</span>
|
826
|
+
<span class="ruby-ivar">@content</span> = <span class="ruby-identifier">result</span>
|
827
|
+
<span class="ruby-identifier">layout</span> = <span class="ruby-identifier">result</span>
|
828
|
+
|
829
|
+
<span class="ruby-identifier">view_layout</span> = <span class="ruby-node">"#{paths[:base_path]}\/app\/views\/layouts\/#{@view}.html"</span>
|
830
|
+
<span class="ruby-identifier">application_layout</span> = <span class="ruby-node">"#{paths[:base_path]}\/app\/views\/layouts\/application.html"</span>
|
831
|
+
|
832
|
+
<span class="ruby-identifier">haml_view_layout</span> = <span class="ruby-identifier">view_layout</span> <span class="ruby-operator">+</span> <span class="ruby-string">".haml"</span>
|
833
|
+
<span class="ruby-identifier">haml_application_layout</span> = <span class="ruby-identifier">application_layout</span> <span class="ruby-operator">+</span> <span class="ruby-string">".haml"</span>
|
834
|
+
|
835
|
+
<span class="ruby-keyword">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">haml_view_layout</span>)
|
836
|
+
<span class="ruby-identifier">layout_name</span> = <span class="ruby-identifier">haml_view_layout</span>
|
837
|
+
<span class="ruby-keyword">else</span>
|
838
|
+
<span class="ruby-identifier">layout_name</span> = <span class="ruby-identifier">haml_application_layout</span>
|
839
|
+
<span class="ruby-keyword">end</span>
|
840
|
+
|
841
|
+
<span class="ruby-keyword">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">layout_name</span>)
|
842
|
+
<span class="ruby-identifier">template</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">layout_name</span>)
|
843
|
+
<span class="ruby-identifier">layout</span> = <span class="ruby-identifier">process_haml</span>(<span class="ruby-identifier">template</span>, <span class="ruby-identifier">layout_name</span>) <span class="ruby-keyword">do</span>
|
844
|
+
<span class="ruby-ivar">@content</span>
|
845
|
+
<span class="ruby-keyword">end</span>
|
846
|
+
<span class="ruby-keyword">end</span>
|
847
|
+
|
848
|
+
<span class="ruby-identifier">write_template_without_layout</span>(<span class="ruby-identifier">layout</span>)
|
849
|
+
<span class="ruby-keyword">end</span></pre>
|
850
|
+
</div><!-- write_template_with_layout-source -->
|
851
|
+
|
852
|
+
</div>
|
853
|
+
|
854
|
+
|
855
|
+
|
856
|
+
|
857
|
+
</div><!-- write_template_with_layout-method -->
|
858
|
+
|
859
|
+
|
860
|
+
<div id="method-i-write_template_without_layout" class="method-detail ">
|
861
|
+
|
862
|
+
<div class="method-heading">
|
863
|
+
<span class="method-name">write_template_without_layout</span><span
|
864
|
+
class="method-args">(result)</span>
|
865
|
+
<span class="method-click-advice">click to toggle source</span>
|
866
|
+
</div>
|
867
|
+
|
868
|
+
|
869
|
+
<div class="method-description">
|
870
|
+
|
871
|
+
<p>Writes the input string to the destination file without adding any layout.</p>
|
872
|
+
|
873
|
+
|
874
|
+
|
875
|
+
<div class="method-source-code" id="write_template_without_layout-source">
|
876
|
+
<pre><span class="ruby-comment"># File lib/ymdp/compiler/template.rb, line 164</span>
|
877
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">write_template_without_layout</span>(<span class="ruby-identifier">result</span>)
|
878
|
+
<span class="ruby-identifier">path</span> = <span class="ruby-identifier">destination_path</span>
|
879
|
+
|
880
|
+
<span class="ruby-comment"># puts "\n\n\nBase write_template_without_layout: #{result}, #{path}"</span>
|
881
|
+
|
882
|
+
<span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">path</span>, <span class="ruby-string">"w"</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
|
883
|
+
<span class="ruby-identifier">f</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">result</span>)
|
884
|
+
<span class="ruby-keyword">end</span>
|
885
|
+
<span class="ruby-identifier">verbose</span> <span class="ruby-node">"Finished writing #{path}.\n"</span>
|
886
|
+
|
887
|
+
<span class="ruby-identifier">result</span>
|
888
|
+
<span class="ruby-keyword">end</span></pre>
|
889
|
+
</div><!-- write_template_without_layout-source -->
|
890
|
+
|
891
|
+
</div>
|
892
|
+
|
893
|
+
|
894
|
+
|
895
|
+
|
896
|
+
</div><!-- write_template_without_layout-method -->
|
897
|
+
|
898
|
+
|
899
|
+
</section><!-- public-instance-method-details -->
|
900
|
+
|
901
|
+
</section><!-- 5Buntitled-5D -->
|
902
|
+
|
903
|
+
</div><!-- documentation -->
|
904
|
+
|
905
|
+
|
906
|
+
<footer id="validator-badges">
|
907
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
908
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
|
909
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
910
|
+
</footer>
|
911
|
+
|