reap 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. data/ChangeLog +2 -0
  2. data/LICENSE +11 -0
  3. data/README +59 -0
  4. data/Reapfile +85 -0
  5. data/bin/reap +103 -0
  6. data/doc/classes/Reap/AnnounceTask.html +331 -0
  7. data/doc/classes/Reap/ChmodTask.html +278 -0
  8. data/doc/classes/Reap/PackageTask.html +372 -0
  9. data/doc/classes/Reap/PublishTask.html +231 -0
  10. data/doc/classes/Reap/RDocTask.html +254 -0
  11. data/doc/classes/Reap/Runner.html +307 -0
  12. data/doc/classes/Reap/Task.html +390 -0
  13. data/doc/classes/Reap/TemplateTask.html +233 -0
  14. data/doc/classes/Reap/TestTask.html +242 -0
  15. data/doc/classes/Reap.html +184 -0
  16. data/doc/created.rid +1 -0
  17. data/doc/files/LICENSE.html +119 -0
  18. data/doc/files/README.html +194 -0
  19. data/doc/files/lib/reap/reap_rb.html +110 -0
  20. data/doc/files/lib/reap/runner_rb.html +113 -0
  21. data/doc/files/lib/reap/task_rb.html +108 -0
  22. data/doc/files/lib/reap/tasks/announce-task_rb.html +113 -0
  23. data/doc/files/lib/reap/tasks/chmod-task_rb.html +101 -0
  24. data/doc/files/lib/reap/tasks/package-task_rb.html +108 -0
  25. data/doc/files/lib/reap/tasks/publish-task_rb.html +101 -0
  26. data/doc/files/lib/reap/tasks/rdoc-task_rb.html +101 -0
  27. data/doc/files/lib/reap/tasks/template-task_rb.html +108 -0
  28. data/doc/files/lib/reap/tasks/test-task_rb.html +101 -0
  29. data/doc/files/lib/reap/template_rb.html +101 -0
  30. data/doc/fr_class_index.html +36 -0
  31. data/doc/fr_file_index.html +39 -0
  32. data/doc/fr_method_index.html +69 -0
  33. data/doc/index.html +24 -0
  34. data/doc/rdoc-style.css +208 -0
  35. data/lib/reap/reap.rb +11 -0
  36. data/lib/reap/runner.rb +95 -0
  37. data/lib/reap/task.rb +103 -0
  38. data/lib/reap/tasks/announce-task.rb +140 -0
  39. data/lib/reap/tasks/chmod-task.rb +72 -0
  40. data/lib/reap/tasks/package-task.rb +153 -0
  41. data/lib/reap/tasks/publish-task.rb +33 -0
  42. data/lib/reap/tasks/rdoc-task.rb +57 -0
  43. data/lib/reap/tasks/template-task.rb +38 -0
  44. data/lib/reap/tasks/test-task.rb +45 -0
  45. data/lib/reap/template.rb +72 -0
  46. data/setup.rb +1361 -0
  47. data/test/test_require.rb +11 -0
  48. metadata +112 -0
@@ -0,0 +1,390 @@
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::Task</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::Task</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../files/lib/reap/task_rb.html">
59
+ lib/reap/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
+ 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
+ Base class for all tasks
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="#M000036">[]</a>&nbsp;&nbsp;
96
+ <a href="#M000032">inherited</a>&nbsp;&nbsp;
97
+ <a href="#M000035">new</a>&nbsp;&nbsp;
98
+ <a href="#M000039">package_name</a>&nbsp;&nbsp;
99
+ <a href="#M000033">registry</a>&nbsp;&nbsp;
100
+ <a href="#M000038">ruby</a>&nbsp;&nbsp;
101
+ <a href="#M000037">sh</a>&nbsp;&nbsp;
102
+ <a href="#M000034">tasks</a>&nbsp;&nbsp;
103
+ </div>
104
+ </div>
105
+
106
+ </div>
107
+
108
+
109
+ <!-- if includes -->
110
+
111
+ <div id="section">
112
+
113
+
114
+ <div id="constants-list">
115
+ <h3 class="section-bar">Constants</h3>
116
+
117
+ <div class="name-list">
118
+ <table summary="Constants">
119
+ <tr class="top-aligned-row context-row">
120
+ <td class="context-item-name">RUBY</td>
121
+ <td>=</td>
122
+ <td class="context-item-value">Config::CONFIG['ruby_install_name']</td>
123
+ </tr>
124
+ <tr class="top-aligned-row context-row">
125
+ <td class="context-item-name">DEFAULT_INCLUDE</td>
126
+ <td>=</td>
127
+ <td class="context-item-value">[ '[A-Z]*', 'setup.rb', 'lib/**/*', 'bin/**/*', 'doc/**/*', 'rdoc/**/*', 'test/**/*', 'bench/**/*', 'demo/**/*', 'samples/**/*', 'examples/**/*' ]</td>
128
+ </tr>
129
+ <tr class="top-aligned-row context-row">
130
+ <td class="context-item-name">MUST_EXCLUDE</td>
131
+ <td>=</td>
132
+ <td class="context-item-value">[ 'InstalledFiles', '**/CVS/**/*', '**/*~' ]</td>
133
+ </tr>
134
+ </table>
135
+ </div>
136
+ </div>
137
+
138
+
139
+
140
+ <div id="attribute-list">
141
+ <h3 class="section-bar">Attributes</h3>
142
+
143
+ <div class="name-list">
144
+ <table>
145
+ <tr class="top-aligned-row context-row">
146
+ <td class="context-item-name">config</td>
147
+ <td class="context-item-value">&nbsp;[R]&nbsp;</td>
148
+ <td class="context-item-desc"></td>
149
+ </tr>
150
+ <tr class="top-aligned-row context-row">
151
+ <td class="context-item-name">section</td>
152
+ <td class="context-item-value">&nbsp;[R]&nbsp;</td>
153
+ <td class="context-item-desc"></td>
154
+ </tr>
155
+ </table>
156
+ </div>
157
+ </div>
158
+
159
+
160
+
161
+ <!-- if method_list -->
162
+ <div id="methods">
163
+ <h3 class="section-bar">Public Class methods</h3>
164
+
165
+ <div id="method-M000032" class="method-detail">
166
+ <a name="M000032"></a>
167
+
168
+ <div class="method-heading">
169
+ <a href="#M000032" class="method-signature">
170
+ <span class="method-name">inherited</span><span class="method-args">( klass )</span>
171
+ </a>
172
+ </div>
173
+
174
+ <div class="method-description">
175
+ <p><a class="source-toggle" href="#"
176
+ onclick="toggleCode('M000032-source');return false;">[Source]</a></p>
177
+ <div class="method-source-code" id="M000032-source">
178
+ <pre>
179
+ <span class="ruby-comment cmt"># File lib/reap/task.rb, line 20</span>
180
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">inherited</span>( <span class="ruby-identifier">klass</span> )
181
+ (<span class="ruby-ivar">@task_registry</span> <span class="ruby-operator">||=</span> []) <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">klass</span>
182
+ <span class="ruby-keyword kw">end</span>
183
+ </pre>
184
+ </div>
185
+ </div>
186
+ </div>
187
+
188
+ <div id="method-M000035" class="method-detail">
189
+ <a name="M000035"></a>
190
+
191
+ <div class="method-heading">
192
+ <a href="#M000035" class="method-signature">
193
+ <span class="method-name">new</span><span class="method-args">( config )</span>
194
+ </a>
195
+ </div>
196
+
197
+ <div class="method-description">
198
+ <p><a class="source-toggle" href="#"
199
+ onclick="toggleCode('M000035-source');return false;">[Source]</a></p>
200
+ <div class="method-source-code" id="M000035-source">
201
+ <pre>
202
+ <span class="ruby-comment cmt"># File lib/reap/task.rb, line 31</span>
203
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>( <span class="ruby-identifier">config</span> )
204
+ <span class="ruby-ivar">@config</span> = <span class="ruby-identifier">config</span>
205
+ <span class="ruby-keyword kw">end</span>
206
+ </pre>
207
+ </div>
208
+ </div>
209
+ </div>
210
+
211
+ <div id="method-M000033" class="method-detail">
212
+ <a name="M000033"></a>
213
+
214
+ <div class="method-heading">
215
+ <a href="#M000033" class="method-signature">
216
+ <span class="method-name">registry</span><span class="method-args">()</span>
217
+ </a>
218
+ </div>
219
+
220
+ <div class="method-description">
221
+ <p><a class="source-toggle" href="#"
222
+ onclick="toggleCode('M000033-source');return false;">[Source]</a></p>
223
+ <div class="method-source-code" id="M000033-source">
224
+ <pre>
225
+ <span class="ruby-comment cmt"># File lib/reap/task.rb, line 24</span>
226
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">registry</span> ; <span class="ruby-ivar">@task_registry</span> <span class="ruby-operator">||=</span> [] ; <span class="ruby-keyword kw">end</span>
227
+ </pre>
228
+ </div>
229
+ </div>
230
+ </div>
231
+
232
+ <div id="method-M000034" class="method-detail">
233
+ <a name="M000034"></a>
234
+
235
+ <div class="method-heading">
236
+ <a href="#M000034" class="method-signature">
237
+ <span class="method-name">tasks</span><span class="method-args">()</span>
238
+ </a>
239
+ </div>
240
+
241
+ <div class="method-description">
242
+ <p><a class="source-toggle" href="#"
243
+ onclick="toggleCode('M000034-source');return false;">[Source]</a></p>
244
+ <div class="method-source-code" id="M000034-source">
245
+ <pre>
246
+ <span class="ruby-comment cmt"># File lib/reap/task.rb, line 26</span>
247
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">tasks</span> ; <span class="ruby-ivar">@task</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">registry</span>.<span class="ruby-identifier">collect</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-keyword kw">end</span>
248
+ </pre>
249
+ </div>
250
+ </div>
251
+ </div>
252
+
253
+ <h3 class="section-bar">Public Instance methods</h3>
254
+
255
+ <div id="method-M000036" class="method-detail">
256
+ <a name="M000036"></a>
257
+
258
+ <div class="method-heading">
259
+ <a href="#M000036" class="method-signature">
260
+ <span class="method-name">[]</span><span class="method-args">(x)</span>
261
+ </a>
262
+ </div>
263
+
264
+ <div class="method-description">
265
+ <p><a class="source-toggle" href="#"
266
+ onclick="toggleCode('M000036-source');return false;">[Source]</a></p>
267
+ <div class="method-source-code" id="M000036-source">
268
+ <pre>
269
+ <span class="ruby-comment cmt"># File lib/reap/task.rb, line 35</span>
270
+ <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]</span>(<span class="ruby-identifier">x</span>)
271
+ <span class="ruby-ivar">@config</span>[<span class="ruby-identifier">x</span>]
272
+ <span class="ruby-keyword kw">end</span>
273
+ </pre>
274
+ </div>
275
+ </div>
276
+ </div>
277
+
278
+ <div id="method-M000039" class="method-detail">
279
+ <a name="M000039"></a>
280
+
281
+ <div class="method-heading">
282
+ <a href="#M000039" class="method-signature">
283
+ <span class="method-name">package_name</span><span class="method-args">()</span>
284
+ </a>
285
+ </div>
286
+
287
+ <div class="method-description">
288
+ <p>
289
+ Returns the full package name which combines package name and version.
290
+ </p>
291
+ <p><a class="source-toggle" href="#"
292
+ onclick="toggleCode('M000039-source');return false;">[Source]</a></p>
293
+ <div class="method-source-code" id="M000039-source">
294
+ <pre>
295
+ <span class="ruby-comment cmt"># File lib/reap/task.rb, line 83</span>
296
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">package_name</span>
297
+ <span class="ruby-ivar">@config</span>[<span class="ruby-value str">'name'</span>] <span class="ruby-operator">+</span> <span class="ruby-value str">'--'</span> <span class="ruby-operator">+</span> ( <span class="ruby-ivar">@config</span>[<span class="ruby-value str">'version'</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">'0.0.1'</span> )
298
+ <span class="ruby-keyword kw">end</span>
299
+ </pre>
300
+ </div>
301
+ </div>
302
+ </div>
303
+
304
+ <div id="method-M000038" class="method-detail">
305
+ <a name="M000038"></a>
306
+
307
+ <div class="method-heading">
308
+ <a href="#M000038" class="method-signature">
309
+ <span class="method-name">ruby</span><span class="method-args">(*args)</span>
310
+ </a>
311
+ </div>
312
+
313
+ <div class="method-description">
314
+ <p>
315
+ Run a Ruby interpreter with the given arguments.
316
+ </p>
317
+ <p>
318
+ Example:
319
+ </p>
320
+ <pre>
321
+ ruby %{-pe '$_.upcase!' &lt;README}
322
+ </pre>
323
+ <p><a class="source-toggle" href="#"
324
+ onclick="toggleCode('M000038-source');return false;">[Source]</a></p>
325
+ <div class="method-source-code" id="M000038-source">
326
+ <pre>
327
+ <span class="ruby-comment cmt"># File lib/reap/task.rb, line 57</span>
328
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ruby</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
329
+ <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Hash</span> <span class="ruby-operator">===</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">last</span>
330
+ <span class="ruby-identifier">options</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">pop</span>
331
+ <span class="ruby-keyword kw">else</span>
332
+ <span class="ruby-identifier">options</span> = {}
333
+ <span class="ruby-keyword kw">end</span>
334
+ <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;#{RUBY} #{args.join(' ')}&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$DEBUG</span>
335
+ <span class="ruby-identifier">sh</span> <span class="ruby-node">&quot;#{RUBY} #{args.join(' ')}&quot;</span>, <span class="ruby-identifier">options</span>
336
+ <span class="ruby-keyword kw">end</span>
337
+ </pre>
338
+ </div>
339
+ </div>
340
+ </div>
341
+
342
+ <div id="method-M000037" class="method-detail">
343
+ <a name="M000037"></a>
344
+
345
+ <div class="method-heading">
346
+ <a href="#M000037" class="method-signature">
347
+ <span class="method-name">sh</span><span class="method-args">(cmd, options={})</span>
348
+ </a>
349
+ </div>
350
+
351
+ <div class="method-description">
352
+ <p>
353
+ Run the system command <tt>cmd</tt>.
354
+ </p>
355
+ <p>
356
+ Example:
357
+ </p>
358
+ <pre>
359
+ sh %{ls -ltr}
360
+ </pre>
361
+ <p><a class="source-toggle" href="#"
362
+ onclick="toggleCode('M000037-source');return false;">[Source]</a></p>
363
+ <div class="method-source-code" id="M000037-source">
364
+ <pre>
365
+ <span class="ruby-comment cmt"># File lib/reap/task.rb, line 44</span>
366
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sh</span>(<span class="ruby-identifier">cmd</span>, <span class="ruby-identifier">options</span>={})
367
+ <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">send</span>( <span class="ruby-identifier">:fu_check_options</span>, <span class="ruby-identifier">options</span>, <span class="ruby-identifier">:noop</span>, <span class="ruby-identifier">:verbose</span> )
368
+ <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">send</span>( <span class="ruby-identifier">:fu_output_message</span>, <span class="ruby-identifier">cmd</span> ) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:verbose</span>]
369
+ <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:noop</span>]
370
+ <span class="ruby-identifier">system</span>(<span class="ruby-identifier">cmd</span>) <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">fail</span> <span class="ruby-node">&quot;Command Failed: [#{cmd}]&quot;</span>
371
+ <span class="ruby-keyword kw">end</span>
372
+ <span class="ruby-keyword kw">end</span>
373
+ </pre>
374
+ </div>
375
+ </div>
376
+ </div>
377
+
378
+
379
+ </div>
380
+
381
+
382
+ </div>
383
+
384
+
385
+ <div id="validator-badges">
386
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
387
+ </div>
388
+
389
+ </body>
390
+ </html>
@@ -0,0 +1,233 @@
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::TemplateTask</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::TemplateTask</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../files/lib/reap/tasks/template-task_rb.html">
59
+ lib/reap/tasks/template-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="#M000024">desc</a>&nbsp;&nbsp;
92
+ <a href="#M000026">run</a>&nbsp;&nbsp;
93
+ <a href="#M000025">set</a>&nbsp;&nbsp;
94
+ <a href="#M000023">task</a>&nbsp;&nbsp;
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-M000024" class="method-detail">
117
+ <a name="M000024"></a>
118
+
119
+ <div class="method-heading">
120
+ <a href="#M000024" 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('M000024-source');return false;">[Source]</a></p>
128
+ <div class="method-source-code" id="M000024-source">
129
+ <pre>
130
+ <span class="ruby-comment cmt"># File lib/reap/tasks/template-task.rb, line 10</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">&quot;Create template configuration file in current directory.&quot;</span> ; <span class="ruby-keyword kw">end</span>
132
+ </pre>
133
+ </div>
134
+ </div>
135
+ </div>
136
+
137
+ <div id="method-M000023" class="method-detail">
138
+ <a name="M000023"></a>
139
+
140
+ <div class="method-heading">
141
+ <a href="#M000023" 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('M000023-source');return false;">[Source]</a></p>
149
+ <div class="method-source-code" id="M000023-source">
150
+ <pre>
151
+ <span class="ruby-comment cmt"># File lib/reap/tasks/template-task.rb, line 8</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">:template</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-M000026" class="method-detail">
161
+ <a name="M000026"></a>
162
+
163
+ <div class="method-heading">
164
+ <a href="#M000026" 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('M000026-source');return false;">[Source]</a></p>
172
+ <div class="method-source-code" id="M000026-source">
173
+ <pre>
174
+ <span class="ruby-comment cmt"># File lib/reap/tasks/template-task.rb, line 16</span>
175
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run</span>
176
+ <span class="ruby-identifier">dir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-keyword kw">__FILE__</span>))
177
+ <span class="ruby-identifier">tmpf</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>( <span class="ruby-identifier">dir</span>, <span class="ruby-value str">'template.rb'</span> )
178
+ <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">file?</span>( <span class="ruby-identifier">tmpf</span> )
179
+ <span class="ruby-identifier">puts</span> <span class="ruby-identifier">tmpf</span>
180
+ <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Tempfile is missing.&quot;</span>
181
+ <span class="ruby-keyword kw">end</span>
182
+
183
+ <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-value str">&quot;Reapfile&quot;</span>)
184
+ <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;Why is Reapfile a directory? Cannot comply.&quot;</span>
185
+ <span class="ruby-keyword kw">return</span>
186
+ <span class="ruby-keyword kw">elsif</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">file?</span>(<span class="ruby-value str">&quot;Reapfile&quot;</span>)
187
+ <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;Reapfile already exists.&quot;</span>
188
+ <span class="ruby-keyword kw">return</span>
189
+ <span class="ruby-keyword kw">end</span>
190
+ <span class="ruby-comment cmt"># copy tmpf to Reapfile</span>
191
+ <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">cp</span>( <span class="ruby-identifier">tmpf</span>, <span class="ruby-value str">&quot;Reapfile&quot;</span> )
192
+ <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;Reapfile create. You'll need to fill it out.&quot;</span>
193
+ <span class="ruby-keyword kw">end</span>
194
+ </pre>
195
+ </div>
196
+ </div>
197
+ </div>
198
+
199
+ <div id="method-M000025" class="method-detail">
200
+ <a name="M000025"></a>
201
+
202
+ <div class="method-heading">
203
+ <a href="#M000025" class="method-signature">
204
+ <span class="method-name">set</span><span class="method-args">( section )</span>
205
+ </a>
206
+ </div>
207
+
208
+ <div class="method-description">
209
+ <p><a class="source-toggle" href="#"
210
+ onclick="toggleCode('M000025-source');return false;">[Source]</a></p>
211
+ <div class="method-source-code" id="M000025-source">
212
+ <pre>
213
+ <span class="ruby-comment cmt"># File lib/reap/tasks/template-task.rb, line 13</span>
214
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set</span>( <span class="ruby-identifier">section</span> )
215
+ <span class="ruby-keyword kw">end</span>
216
+ </pre>
217
+ </div>
218
+ </div>
219
+ </div>
220
+
221
+
222
+ </div>
223
+
224
+
225
+ </div>
226
+
227
+
228
+ <div id="validator-badges">
229
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
230
+ </div>
231
+
232
+ </body>
233
+ </html>