reap 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +2 -0
- data/LICENSE +11 -0
- data/README +59 -0
- data/Reapfile +85 -0
- data/bin/reap +103 -0
- data/doc/classes/Reap/AnnounceTask.html +331 -0
- data/doc/classes/Reap/ChmodTask.html +278 -0
- data/doc/classes/Reap/PackageTask.html +372 -0
- data/doc/classes/Reap/PublishTask.html +231 -0
- data/doc/classes/Reap/RDocTask.html +254 -0
- data/doc/classes/Reap/Runner.html +307 -0
- data/doc/classes/Reap/Task.html +390 -0
- data/doc/classes/Reap/TemplateTask.html +233 -0
- data/doc/classes/Reap/TestTask.html +242 -0
- data/doc/classes/Reap.html +184 -0
- data/doc/created.rid +1 -0
- data/doc/files/LICENSE.html +119 -0
- data/doc/files/README.html +194 -0
- data/doc/files/lib/reap/reap_rb.html +110 -0
- data/doc/files/lib/reap/runner_rb.html +113 -0
- data/doc/files/lib/reap/task_rb.html +108 -0
- data/doc/files/lib/reap/tasks/announce-task_rb.html +113 -0
- data/doc/files/lib/reap/tasks/chmod-task_rb.html +101 -0
- data/doc/files/lib/reap/tasks/package-task_rb.html +108 -0
- data/doc/files/lib/reap/tasks/publish-task_rb.html +101 -0
- data/doc/files/lib/reap/tasks/rdoc-task_rb.html +101 -0
- data/doc/files/lib/reap/tasks/template-task_rb.html +108 -0
- data/doc/files/lib/reap/tasks/test-task_rb.html +101 -0
- data/doc/files/lib/reap/template_rb.html +101 -0
- data/doc/fr_class_index.html +36 -0
- data/doc/fr_file_index.html +39 -0
- data/doc/fr_method_index.html +69 -0
- data/doc/index.html +24 -0
- data/doc/rdoc-style.css +208 -0
- data/lib/reap/reap.rb +11 -0
- data/lib/reap/runner.rb +95 -0
- data/lib/reap/task.rb +103 -0
- data/lib/reap/tasks/announce-task.rb +140 -0
- data/lib/reap/tasks/chmod-task.rb +72 -0
- data/lib/reap/tasks/package-task.rb +153 -0
- data/lib/reap/tasks/publish-task.rb +33 -0
- data/lib/reap/tasks/rdoc-task.rb +57 -0
- data/lib/reap/tasks/template-task.rb +38 -0
- data/lib/reap/tasks/test-task.rb +45 -0
- data/lib/reap/template.rb +72 -0
- data/setup.rb +1361 -0
- data/test/test_require.rb +11 -0
- metadata +112 -0
@@ -0,0 +1,254 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: Reap::RDocTask</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">Reap::RDocTask</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/lib/reap/tasks/rdoc-task_rb.html">
|
59
|
+
lib/reap/tasks/rdoc-task.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
<a href="Task.html">
|
69
|
+
Task
|
70
|
+
</a>
|
71
|
+
</td>
|
72
|
+
</tr>
|
73
|
+
</table>
|
74
|
+
</div>
|
75
|
+
<!-- banner header -->
|
76
|
+
|
77
|
+
<div id="bodyContent">
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
<div id="contextContent">
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
</div>
|
86
|
+
|
87
|
+
<div id="method-list">
|
88
|
+
<h3 class="section-bar">Methods</h3>
|
89
|
+
|
90
|
+
<div class="name-list">
|
91
|
+
<a href="#M000007">desc</a>
|
92
|
+
<a href="#M000009">run</a>
|
93
|
+
<a href="#M000008">set</a>
|
94
|
+
<a href="#M000006">task</a>
|
95
|
+
</div>
|
96
|
+
</div>
|
97
|
+
|
98
|
+
</div>
|
99
|
+
|
100
|
+
|
101
|
+
<!-- if includes -->
|
102
|
+
|
103
|
+
<div id="section">
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
<!-- if method_list -->
|
113
|
+
<div id="methods">
|
114
|
+
<h3 class="section-bar">Public Class methods</h3>
|
115
|
+
|
116
|
+
<div id="method-M000007" class="method-detail">
|
117
|
+
<a name="M000007"></a>
|
118
|
+
|
119
|
+
<div class="method-heading">
|
120
|
+
<a href="#M000007" class="method-signature">
|
121
|
+
<span class="method-name">desc</span><span class="method-args">()</span>
|
122
|
+
</a>
|
123
|
+
</div>
|
124
|
+
|
125
|
+
<div class="method-description">
|
126
|
+
<p><a class="source-toggle" href="#"
|
127
|
+
onclick="toggleCode('M000007-source');return false;">[Source]</a></p>
|
128
|
+
<div class="method-source-code" id="M000007-source">
|
129
|
+
<pre>
|
130
|
+
<span class="ruby-comment cmt"># File lib/reap/tasks/rdoc-task.rb, line 8</span>
|
131
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">desc</span> ; <span class="ruby-value str">"Generate RDocs."</span> ; <span class="ruby-keyword kw">end</span>
|
132
|
+
</pre>
|
133
|
+
</div>
|
134
|
+
</div>
|
135
|
+
</div>
|
136
|
+
|
137
|
+
<div id="method-M000006" class="method-detail">
|
138
|
+
<a name="M000006"></a>
|
139
|
+
|
140
|
+
<div class="method-heading">
|
141
|
+
<a href="#M000006" class="method-signature">
|
142
|
+
<span class="method-name">task</span><span class="method-args">()</span>
|
143
|
+
</a>
|
144
|
+
</div>
|
145
|
+
|
146
|
+
<div class="method-description">
|
147
|
+
<p><a class="source-toggle" href="#"
|
148
|
+
onclick="toggleCode('M000006-source');return false;">[Source]</a></p>
|
149
|
+
<div class="method-source-code" id="M000006-source">
|
150
|
+
<pre>
|
151
|
+
<span class="ruby-comment cmt"># File lib/reap/tasks/rdoc-task.rb, line 6</span>
|
152
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">task</span>; <span class="ruby-identifier">:rdoc</span> ; <span class="ruby-keyword kw">end</span>
|
153
|
+
</pre>
|
154
|
+
</div>
|
155
|
+
</div>
|
156
|
+
</div>
|
157
|
+
|
158
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
159
|
+
|
160
|
+
<div id="method-M000009" class="method-detail">
|
161
|
+
<a name="M000009"></a>
|
162
|
+
|
163
|
+
<div class="method-heading">
|
164
|
+
<a href="#M000009" class="method-signature">
|
165
|
+
<span class="method-name">run</span><span class="method-args">()</span>
|
166
|
+
</a>
|
167
|
+
</div>
|
168
|
+
|
169
|
+
<div class="method-description">
|
170
|
+
<p><a class="source-toggle" href="#"
|
171
|
+
onclick="toggleCode('M000009-source');return false;">[Source]</a></p>
|
172
|
+
<div class="method-source-code" id="M000009-source">
|
173
|
+
<pre>
|
174
|
+
<span class="ruby-comment cmt"># File lib/reap/tasks/rdoc-task.rb, line 21</span>
|
175
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run</span>
|
176
|
+
<span class="ruby-identifier">rdoc_dir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-ivar">@dir</span>)
|
177
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-constant">FileTest</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-ivar">@dir</span>)
|
178
|
+
<span class="ruby-identifier">print</span> <span class="ruby-node">"Directory '#{@dir}' already exists. Clobber? [y/N] "</span>
|
179
|
+
<span class="ruby-keyword kw">until</span> <span class="ruby-identifier">inp</span> = <span class="ruby-identifier">$stdin</span>.<span class="ruby-identifier">gets</span>[<span class="ruby-value">0</span>,<span class="ruby-value">1</span>] ; <span class="ruby-identifier">sleep</span> <span class="ruby-value">1</span> ; <span class="ruby-keyword kw">end</span> ; <span class="ruby-identifier">puts</span>
|
180
|
+
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">inp</span> <span class="ruby-operator">||</span> <span class="ruby-value str">'y'</span>).<span class="ruby-identifier">downcase</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'y'</span>
|
181
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-node">"Removing old directory '#{rdoc_dir}'..."</span>
|
182
|
+
<span class="ruby-identifier">trash_dir</span> = <span class="ruby-node">".trash/#{File.basename(@dir)}"</span>
|
183
|
+
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>(<span class="ruby-value str">".trash"</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">FileTest</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-value str">".trash"</span>)
|
184
|
+
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">rm_r</span>(<span class="ruby-identifier">trash_dir</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-constant">FileTest</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">trash_dir</span>)
|
185
|
+
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mv</span>(<span class="ruby-ivar">@dir</span>, <span class="ruby-identifier">trash_dir</span>)
|
186
|
+
<span class="ruby-keyword kw">else</span>
|
187
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-value str">"Packmule rdoc task canceled."</span>
|
188
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
|
189
|
+
<span class="ruby-keyword kw">end</span>
|
190
|
+
<span class="ruby-keyword kw">end</span>
|
191
|
+
<span class="ruby-identifier">rdoc_target</span> = <span class="ruby-node">"#{rdoc_dir}/index.html"</span>
|
192
|
+
<span class="ruby-comment cmt"># rdoc files</span>
|
193
|
+
<span class="ruby-identifier">rdoc_files</span> = <span class="ruby-constant">FileList</span>.<span class="ruby-identifier">new</span>
|
194
|
+
<span class="ruby-identifier">rdoc_files</span>.<span class="ruby-identifier">include</span>(<span class="ruby-operator">*</span><span class="ruby-ivar">@include</span>)
|
195
|
+
<span class="ruby-identifier">rdoc_files</span>.<span class="ruby-identifier">exclude</span>(<span class="ruby-operator">*</span><span class="ruby-ivar">@exclude</span>)
|
196
|
+
<span class="ruby-identifier">rdoc_files</span> = <span class="ruby-value str">'"'</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">rdoc_files</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">'" "'</span>) <span class="ruby-operator"><<</span> <span class="ruby-value str">'"'</span>
|
197
|
+
<span class="ruby-comment cmt"># build options string</span>
|
198
|
+
<span class="ruby-identifier">build</span> = <span class="ruby-ivar">@options</span>.<span class="ruby-identifier">dup</span>
|
199
|
+
<span class="ruby-identifier">build</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"--main '#{@main}'"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@main</span>
|
200
|
+
<span class="ruby-identifier">build</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"--title '#{@title}'"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@title</span>
|
201
|
+
<span class="ruby-identifier">build</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"-T '#{@template}'"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@template</span>
|
202
|
+
<span class="ruby-identifier">rdoc_opts</span> = <span class="ruby-identifier">build</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">' '</span>)
|
203
|
+
<span class="ruby-comment cmt"># do it!</span>
|
204
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-value str">"PackMule is shelling work out to RDoc..."</span>
|
205
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-node">%{rdoc -o #{@dir} #{rdoc_opts}}</span>
|
206
|
+
<span class="ruby-identifier">sh</span> <span class="ruby-node">%{rdoc -o #{rdoc_dir} #{rdoc_opts} #{rdoc_files}}</span>
|
207
|
+
<span class="ruby-keyword kw">end</span>
|
208
|
+
</pre>
|
209
|
+
</div>
|
210
|
+
</div>
|
211
|
+
</div>
|
212
|
+
|
213
|
+
<div id="method-M000008" class="method-detail">
|
214
|
+
<a name="M000008"></a>
|
215
|
+
|
216
|
+
<div class="method-heading">
|
217
|
+
<a href="#M000008" class="method-signature">
|
218
|
+
<span class="method-name">set</span><span class="method-args">( section )</span>
|
219
|
+
</a>
|
220
|
+
</div>
|
221
|
+
|
222
|
+
<div class="method-description">
|
223
|
+
<p><a class="source-toggle" href="#"
|
224
|
+
onclick="toggleCode('M000008-source');return false;">[Source]</a></p>
|
225
|
+
<div class="method-source-code" id="M000008-source">
|
226
|
+
<pre>
|
227
|
+
<span class="ruby-comment cmt"># File lib/reap/tasks/rdoc-task.rb, line 11</span>
|
228
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set</span>( <span class="ruby-identifier">section</span> )
|
229
|
+
<span class="ruby-ivar">@dir</span> = <span class="ruby-identifier">section</span>[<span class="ruby-value str">"dir"</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">'doc/rdoc'</span>
|
230
|
+
<span class="ruby-ivar">@main</span> = <span class="ruby-identifier">section</span>[<span class="ruby-value str">"main"</span>]
|
231
|
+
<span class="ruby-ivar">@title</span> = <span class="ruby-identifier">section</span>[<span class="ruby-value str">"title"</span>] <span class="ruby-operator">||</span> <span class="ruby-ivar">@config</span>[<span class="ruby-value str">"title"</span>]
|
232
|
+
<span class="ruby-ivar">@template</span> = <span class="ruby-identifier">section</span>[<span class="ruby-value str">"template"</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">'html'</span>
|
233
|
+
<span class="ruby-ivar">@include</span> = <span class="ruby-identifier">section</span>[<span class="ruby-value str">"include"</span>] <span class="ruby-operator">||</span> [<span class="ruby-value str">'lib/**/*'</span>]
|
234
|
+
<span class="ruby-ivar">@exclude</span> = <span class="ruby-identifier">section</span>[<span class="ruby-value str">"exclude"</span>]
|
235
|
+
<span class="ruby-ivar">@options</span> = <span class="ruby-identifier">section</span>[<span class="ruby-value str">"options"</span>] <span class="ruby-operator">||</span> []
|
236
|
+
<span class="ruby-keyword kw">end</span>
|
237
|
+
</pre>
|
238
|
+
</div>
|
239
|
+
</div>
|
240
|
+
</div>
|
241
|
+
|
242
|
+
|
243
|
+
</div>
|
244
|
+
|
245
|
+
|
246
|
+
</div>
|
247
|
+
|
248
|
+
|
249
|
+
<div id="validator-badges">
|
250
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
251
|
+
</div>
|
252
|
+
|
253
|
+
</body>
|
254
|
+
</html>
|
@@ -0,0 +1,307 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: Reap::Runner</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">Reap::Runner</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/lib/reap/runner_rb.html">
|
59
|
+
lib/reap/runner.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
Object
|
69
|
+
</td>
|
70
|
+
</tr>
|
71
|
+
</table>
|
72
|
+
</div>
|
73
|
+
<!-- banner header -->
|
74
|
+
|
75
|
+
<div id="bodyContent">
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<div id="contextContent">
|
80
|
+
|
81
|
+
<div id="description">
|
82
|
+
<p>
|
83
|
+
Main <a href="Runner.html">Runner</a> class
|
84
|
+
</p>
|
85
|
+
|
86
|
+
</div>
|
87
|
+
|
88
|
+
|
89
|
+
</div>
|
90
|
+
|
91
|
+
<div id="method-list">
|
92
|
+
<h3 class="section-bar">Methods</h3>
|
93
|
+
|
94
|
+
<div class="name-list">
|
95
|
+
<a href="#M000031">acknowledge</a>
|
96
|
+
<a href="#M000029">call</a>
|
97
|
+
<a href="#M000027">new</a>
|
98
|
+
<a href="#M000030">run</a>
|
99
|
+
<a href="#M000028">task?</a>
|
100
|
+
</div>
|
101
|
+
</div>
|
102
|
+
|
103
|
+
</div>
|
104
|
+
|
105
|
+
|
106
|
+
<!-- if includes -->
|
107
|
+
|
108
|
+
<div id="section">
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
<div id="attribute-list">
|
115
|
+
<h3 class="section-bar">Attributes</h3>
|
116
|
+
|
117
|
+
<div class="name-list">
|
118
|
+
<table>
|
119
|
+
<tr class="top-aligned-row context-row">
|
120
|
+
<td class="context-item-name">config</td>
|
121
|
+
<td class="context-item-value"> [R] </td>
|
122
|
+
<td class="context-item-desc"></td>
|
123
|
+
</tr>
|
124
|
+
</table>
|
125
|
+
</div>
|
126
|
+
</div>
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
<!-- if method_list -->
|
131
|
+
<div id="methods">
|
132
|
+
<h3 class="section-bar">Public Class methods</h3>
|
133
|
+
|
134
|
+
<div id="method-M000027" class="method-detail">
|
135
|
+
<a name="M000027"></a>
|
136
|
+
|
137
|
+
<div class="method-heading">
|
138
|
+
<a href="#M000027" class="method-signature">
|
139
|
+
<span class="method-name">new</span><span class="method-args">( config_file=nil )</span>
|
140
|
+
</a>
|
141
|
+
</div>
|
142
|
+
|
143
|
+
<div class="method-description">
|
144
|
+
<p><a class="source-toggle" href="#"
|
145
|
+
onclick="toggleCode('M000027-source');return false;">[Source]</a></p>
|
146
|
+
<div class="method-source-code" id="M000027-source">
|
147
|
+
<pre>
|
148
|
+
<span class="ruby-comment cmt"># File lib/reap/runner.rb, line 29</span>
|
149
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>( <span class="ruby-identifier">config_file</span>=<span class="ruby-keyword kw">nil</span> )
|
150
|
+
<span class="ruby-identifier">config_file</span> <span class="ruby-operator">||=</span> <span class="ruby-value str">'Reapfile'</span>
|
151
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">file?</span>( <span class="ruby-identifier">config_file</span> )
|
152
|
+
<span class="ruby-comment cmt"># load config file</span>
|
153
|
+
<span class="ruby-identifier">config</span> = <span class="ruby-constant">YAML</span>.<span class="ruby-identifier">load</span>( <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>( <span class="ruby-identifier">config_file</span> ) )
|
154
|
+
<span class="ruby-identifier">config</span>.<span class="ruby-identifier">traverse!</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> [<span class="ruby-identifier">k</span>.<span class="ruby-identifier">downcase</span>, <span class="ruby-identifier">v</span>] }
|
155
|
+
<span class="ruby-ivar">@config</span> = <span class="ruby-identifier">config</span>
|
156
|
+
|
157
|
+
<span class="ruby-comment cmt"># main parameters</span>
|
158
|
+
<span class="ruby-ivar">@title</span> = <span class="ruby-ivar">@config</span>[<span class="ruby-value str">'title'</span>]
|
159
|
+
<span class="ruby-ivar">@name</span> = <span class="ruby-ivar">@config</span>[<span class="ruby-value str">'name'</span>]
|
160
|
+
<span class="ruby-ivar">@version</span> = <span class="ruby-ivar">@config</span>[<span class="ruby-value str">'version'</span>]
|
161
|
+
<span class="ruby-ivar">@summary</span> = <span class="ruby-ivar">@config</span>[<span class="ruby-value str">'summary'</span>]
|
162
|
+
<span class="ruby-ivar">@description</span> = <span class="ruby-ivar">@config</span>[<span class="ruby-value str">'description'</span>]
|
163
|
+
|
164
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-value str">"TITLE is a required configuration field"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@title</span>
|
165
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-value str">"NAME is a required configuration field"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@name</span>
|
166
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-value str">"VERSION is a required configuration field"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@version</span>
|
167
|
+
<span class="ruby-keyword kw">else</span>
|
168
|
+
<span class="ruby-ivar">@config</span> = {}
|
169
|
+
<span class="ruby-keyword kw">end</span>
|
170
|
+
<span class="ruby-keyword kw">end</span>
|
171
|
+
</pre>
|
172
|
+
</div>
|
173
|
+
</div>
|
174
|
+
</div>
|
175
|
+
|
176
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
177
|
+
|
178
|
+
<div id="method-M000031" class="method-detail">
|
179
|
+
<a name="M000031"></a>
|
180
|
+
|
181
|
+
<div class="method-heading">
|
182
|
+
<a href="#M000031" class="method-signature">
|
183
|
+
<span class="method-name">acknowledge</span><span class="method-args">()</span>
|
184
|
+
</a>
|
185
|
+
</div>
|
186
|
+
|
187
|
+
<div class="method-description">
|
188
|
+
<p><a class="source-toggle" href="#"
|
189
|
+
onclick="toggleCode('M000031-source');return false;">[Source]</a></p>
|
190
|
+
<div class="method-source-code" id="M000031-source">
|
191
|
+
<pre>
|
192
|
+
<span class="ruby-comment cmt"># File lib/reap/runner.rb, line 89</span>
|
193
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">acknowledge</span>
|
194
|
+
<span class="ruby-identifier">y</span> <span class="ruby-ivar">@config</span>
|
195
|
+
<span class="ruby-keyword kw">end</span>
|
196
|
+
</pre>
|
197
|
+
</div>
|
198
|
+
</div>
|
199
|
+
</div>
|
200
|
+
|
201
|
+
<div id="method-M000029" class="method-detail">
|
202
|
+
<a name="M000029"></a>
|
203
|
+
|
204
|
+
<div class="method-heading">
|
205
|
+
<a href="#M000029" class="method-signature">
|
206
|
+
<span class="method-name">call</span><span class="method-args">( tsk, *args )</span>
|
207
|
+
</a>
|
208
|
+
</div>
|
209
|
+
|
210
|
+
<div class="method-description">
|
211
|
+
<p><a class="source-toggle" href="#"
|
212
|
+
onclick="toggleCode('M000029-source');return false;">[Source]</a></p>
|
213
|
+
<div class="method-source-code" id="M000029-source">
|
214
|
+
<pre>
|
215
|
+
<span class="ruby-comment cmt"># File lib/reap/runner.rb, line 63</span>
|
216
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">call</span>( <span class="ruby-identifier">tsk</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span> )
|
217
|
+
<span class="ruby-identifier">tsk</span> = <span class="ruby-identifier">tsk</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">downcase</span>.<span class="ruby-identifier">to_sym</span>
|
218
|
+
<span class="ruby-keyword kw">case</span> <span class="ruby-identifier">tsk</span>
|
219
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:acknowledge</span>, <span class="ruby-identifier">:show</span>
|
220
|
+
<span class="ruby-identifier">acknowledge</span>
|
221
|
+
<span class="ruby-keyword kw">else</span>
|
222
|
+
<span class="ruby-identifier">run</span>( <span class="ruby-identifier">tsk</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span> )
|
223
|
+
<span class="ruby-keyword kw">end</span>
|
224
|
+
<span class="ruby-keyword kw">end</span>
|
225
|
+
</pre>
|
226
|
+
</div>
|
227
|
+
</div>
|
228
|
+
</div>
|
229
|
+
|
230
|
+
<div id="method-M000030" class="method-detail">
|
231
|
+
<a name="M000030"></a>
|
232
|
+
|
233
|
+
<div class="method-heading">
|
234
|
+
<a href="#M000030" class="method-signature">
|
235
|
+
<span class="method-name">run</span><span class="method-args">( tsk, *args )</span>
|
236
|
+
</a>
|
237
|
+
</div>
|
238
|
+
|
239
|
+
<div class="method-description">
|
240
|
+
<p><a class="source-toggle" href="#"
|
241
|
+
onclick="toggleCode('M000030-source');return false;">[Source]</a></p>
|
242
|
+
<div class="method-source-code" id="M000030-source">
|
243
|
+
<pre>
|
244
|
+
<span class="ruby-comment cmt"># File lib/reap/runner.rb, line 73</span>
|
245
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run</span>( <span class="ruby-identifier">tsk</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span> )
|
246
|
+
<span class="ruby-identifier">taskClass</span> = <span class="ruby-constant">Task</span>.<span class="ruby-identifier">registry</span>.<span class="ruby-identifier">find</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">t</span><span class="ruby-operator">|</span> <span class="ruby-identifier">t</span>.<span class="ruby-identifier">task</span>.<span class="ruby-identifier">to_sym</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">tsk</span> }
|
247
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-value str">"Task undefined."</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">taskClass</span> <span class="ruby-comment cmt"># should not happen</span>
|
248
|
+
<span class="ruby-identifier">task</span> = <span class="ruby-identifier">taskClass</span>.<span class="ruby-identifier">new</span>( <span class="ruby-ivar">@config</span> )
|
249
|
+
<span class="ruby-identifier">section</span> = <span class="ruby-identifier">taskClass</span>.<span class="ruby-identifier">task</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">downcase</span>
|
250
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@config</span>[<span class="ruby-identifier">section</span>].<span class="ruby-identifier">is_a?</span>( <span class="ruby-constant">Array</span> )
|
251
|
+
<span class="ruby-ivar">@config</span>[<span class="ruby-identifier">section</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span>
|
252
|
+
<span class="ruby-identifier">task</span>.<span class="ruby-identifier">set</span>( <span class="ruby-identifier">s</span> )
|
253
|
+
<span class="ruby-identifier">task</span>.<span class="ruby-identifier">run</span>
|
254
|
+
<span class="ruby-keyword kw">end</span>
|
255
|
+
<span class="ruby-keyword kw">else</span>
|
256
|
+
<span class="ruby-identifier">task</span>.<span class="ruby-identifier">set</span>( <span class="ruby-ivar">@config</span>[<span class="ruby-identifier">section</span>] )
|
257
|
+
<span class="ruby-identifier">task</span>.<span class="ruby-identifier">run</span>
|
258
|
+
<span class="ruby-keyword kw">end</span>
|
259
|
+
<span class="ruby-keyword kw">end</span>
|
260
|
+
</pre>
|
261
|
+
</div>
|
262
|
+
</div>
|
263
|
+
</div>
|
264
|
+
|
265
|
+
<div id="method-M000028" class="method-detail">
|
266
|
+
<a name="M000028"></a>
|
267
|
+
|
268
|
+
<div class="method-heading">
|
269
|
+
<a href="#M000028" class="method-signature">
|
270
|
+
<span class="method-name">task?</span><span class="method-args">( tsk )</span>
|
271
|
+
</a>
|
272
|
+
</div>
|
273
|
+
|
274
|
+
<div class="method-description">
|
275
|
+
<p><a class="source-toggle" href="#"
|
276
|
+
onclick="toggleCode('M000028-source');return false;">[Source]</a></p>
|
277
|
+
<div class="method-source-code" id="M000028-source">
|
278
|
+
<pre>
|
279
|
+
<span class="ruby-comment cmt"># File lib/reap/runner.rb, line 52</span>
|
280
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">task?</span>( <span class="ruby-identifier">tsk</span> )
|
281
|
+
<span class="ruby-identifier">tsk</span> = <span class="ruby-identifier">tsk</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">downcase</span>.<span class="ruby-identifier">to_sym</span>
|
282
|
+
<span class="ruby-keyword kw">case</span> <span class="ruby-identifier">tsk</span>
|
283
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:acknowledge</span>, <span class="ruby-identifier">:show</span>
|
284
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
|
285
|
+
<span class="ruby-keyword kw">else</span>
|
286
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Reap</span><span class="ruby-operator">::</span><span class="ruby-constant">Task</span>.<span class="ruby-identifier">tasks</span>.<span class="ruby-identifier">include?</span>( <span class="ruby-identifier">tsk</span> )
|
287
|
+
<span class="ruby-keyword kw">end</span>
|
288
|
+
<span class="ruby-keyword kw">false</span>
|
289
|
+
<span class="ruby-keyword kw">end</span>
|
290
|
+
</pre>
|
291
|
+
</div>
|
292
|
+
</div>
|
293
|
+
</div>
|
294
|
+
|
295
|
+
|
296
|
+
</div>
|
297
|
+
|
298
|
+
|
299
|
+
</div>
|
300
|
+
|
301
|
+
|
302
|
+
<div id="validator-badges">
|
303
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
304
|
+
</div>
|
305
|
+
|
306
|
+
</body>
|
307
|
+
</html>
|