genosaurus 1.1.4 → 1.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README +1 -1
- data/doc/classes/Genosaurus.html +110 -108
- data/doc/created.rid +1 -1
- data/doc/files/README.html +1 -1
- data/doc/files/lib/genosaurus_rb.html +1 -1
- data/lib/genosaurus.rb +2 -0
- metadata +3 -9
data/README
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
=Hello, and welcome to Genosaurus!
|
2
2
|
|
3
|
-
Genosaurus is meant to be a very, very easy to use generation system for Ruby. It's simple and straightforward, yet offers plenty of flexibility in it's use. People use 'generators' all the time, and you either have to roll your own, or use some really cumbersome generator that some one else wrote, that is just way too difficult to use. Enter Genosaurus!
|
3
|
+
Genosaurus is meant to be a very, very easy to use generation system for Ruby. It's simple and straightforward, yet offers plenty of flexibility in it's use. People use 'generators' all the time, and you either have to roll your own, or use some really cumbersome generator that some one else wrote, that is just way too difficult to use. Enter Genosaurus!
|
4
4
|
|
5
5
|
==Installation
|
6
6
|
$ sudo gem install genosaurus
|
data/doc/classes/Genosaurus.html
CHANGED
@@ -166,9 +166,11 @@ initialization.
|
|
166
166
|
36: <span class="ruby-ivar">@templates_directory_path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-identifier">f</span>), <span class="ruby-value str">"templates"</span>)
|
167
167
|
37: <span class="ruby-ivar">@manifest_path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-identifier">f</span>), <span class="ruby-value str">"manifest.yml"</span>)
|
168
168
|
38: <span class="ruby-keyword kw">end</span>
|
169
|
-
39: <span class="ruby-keyword kw">
|
170
|
-
40:
|
171
|
-
41:
|
169
|
+
39: <span class="ruby-keyword kw">else</span>
|
170
|
+
40: <span class="ruby-identifier">raise</span> <span class="ruby-value str">"Unable to dynamically figure out your templates_directory_path and manifest_path! Please implement these methods and let Genosaurus know where to find these things. Thanks."</span>
|
171
|
+
41: <span class="ruby-keyword kw">end</span>
|
172
|
+
42: <span class="ruby-identifier">setup</span>
|
173
|
+
43: <span class="ruby-keyword kw">end</span>
|
172
174
|
</pre>
|
173
175
|
</div>
|
174
176
|
</div>
|
@@ -191,11 +193,11 @@ Used to define arguments that are required by the generator.
|
|
191
193
|
onclick="toggleCode('M000009-source');return false;">[Source]</a></p>
|
192
194
|
<div class="method-source-code" id="M000009-source">
|
193
195
|
<pre>
|
194
|
-
<span class="ruby-comment cmt"># File lib/genosaurus.rb, line
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
196
|
+
<span class="ruby-comment cmt"># File lib/genosaurus.rb, line 105</span>
|
197
|
+
105: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">require_param</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
198
|
+
106: <span class="ruby-identifier">required_params</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">args</span>
|
199
|
+
107: <span class="ruby-identifier">required_params</span>.<span class="ruby-identifier">flatten!</span>
|
200
|
+
108: <span class="ruby-keyword kw">end</span>
|
199
201
|
</pre>
|
200
202
|
</div>
|
201
203
|
</div>
|
@@ -218,10 +220,10 @@ Returns the <a href="Genosaurus.html#M000010">required_params</a> array.
|
|
218
220
|
onclick="toggleCode('M000010-source');return false;">[Source]</a></p>
|
219
221
|
<div class="method-source-code" id="M000010-source">
|
220
222
|
<pre>
|
221
|
-
<span class="ruby-comment cmt"># File lib/genosaurus.rb, line
|
222
|
-
|
223
|
-
|
224
|
-
|
223
|
+
<span class="ruby-comment cmt"># File lib/genosaurus.rb, line 111</span>
|
224
|
+
111: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">required_params</span>
|
225
|
+
112: <span class="ruby-ivar">@required_params</span> <span class="ruby-operator">||=</span> []
|
226
|
+
113: <span class="ruby-keyword kw">end</span>
|
225
227
|
</pre>
|
226
228
|
</div>
|
227
229
|
</div>
|
@@ -280,9 +282,9 @@ generators.
|
|
280
282
|
onclick="toggleCode('M000007-source');return false;">[Source]</a></p>
|
281
283
|
<div class="method-source-code" id="M000007-source">
|
282
284
|
<pre>
|
283
|
-
<span class="ruby-comment cmt"># File lib/genosaurus.rb, line
|
284
|
-
|
285
|
-
|
285
|
+
<span class="ruby-comment cmt"># File lib/genosaurus.rb, line 72</span>
|
286
|
+
72: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">after_generate</span>
|
287
|
+
73: <span class="ruby-keyword kw">end</span>
|
286
288
|
</pre>
|
287
289
|
</div>
|
288
290
|
</div>
|
@@ -307,9 +309,9 @@ href="Genosaurus.html#M000001">run</a>.
|
|
307
309
|
onclick="toggleCode('M000006-source');return false;">[Source]</a></p>
|
308
310
|
<div class="method-source-code" id="M000006-source">
|
309
311
|
<pre>
|
310
|
-
<span class="ruby-comment cmt"># File lib/genosaurus.rb, line
|
311
|
-
|
312
|
-
|
312
|
+
<span class="ruby-comment cmt"># File lib/genosaurus.rb, line 67</span>
|
313
|
+
67: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">before_generate</span>
|
314
|
+
68: <span class="ruby-keyword kw">end</span>
|
313
315
|
</pre>
|
314
316
|
</div>
|
315
317
|
</div>
|
@@ -329,12 +331,12 @@ href="Genosaurus.html#M000001">run</a>.
|
|
329
331
|
onclick="toggleCode('M000014-source');return false;">[Source]</a></p>
|
330
332
|
<div class="method-source-code" id="M000014-source">
|
331
333
|
<pre>
|
332
|
-
<span class="ruby-comment cmt"># File lib/genosaurus.rb, line
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
334
|
+
<span class="ruby-comment cmt"># File lib/genosaurus.rb, line 145</span>
|
335
|
+
145: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">copy</span>(<span class="ruby-identifier">input_file</span>, <span class="ruby-identifier">output_file</span>, <span class="ruby-identifier">options</span> = <span class="ruby-ivar">@options</span>)
|
336
|
+
146: <span class="ruby-identifier">output_file</span> = <span class="ruby-identifier">template_copy_common</span>(<span class="ruby-identifier">output_file</span>, <span class="ruby-identifier">options</span>)
|
337
|
+
147: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">cp</span>(<span class="ruby-identifier">input_file</span>, <span class="ruby-identifier">output_file</span>)
|
338
|
+
148: <span class="ruby-identifier">puts</span> <span class="ruby-node">"Copied: #{output_file}"</span>
|
339
|
+
149: <span class="ruby-keyword kw">end</span>
|
338
340
|
</pre>
|
339
341
|
</div>
|
340
342
|
</div>
|
@@ -357,18 +359,18 @@ Creates the specified <a href="Genosaurus.html#M000013">directory</a>.
|
|
357
359
|
onclick="toggleCode('M000013-source');return false;">[Source]</a></p>
|
358
360
|
<div class="method-source-code" id="M000013-source">
|
359
361
|
<pre>
|
360
|
-
<span class="ruby-comment cmt"># File lib/genosaurus.rb, line
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
362
|
+
<span class="ruby-comment cmt"># File lib/genosaurus.rb, line 133</span>
|
363
|
+
133: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">directory</span>(<span class="ruby-identifier">output_dir</span>, <span class="ruby-identifier">options</span> = <span class="ruby-ivar">@options</span>)
|
364
|
+
134: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$genosaurus_output_directory</span>
|
365
|
+
135: <span class="ruby-identifier">output_dir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">$genosaurus_output_directory</span>, <span class="ruby-identifier">output_dir</span>)
|
366
|
+
136: <span class="ruby-keyword kw">end</span>
|
367
|
+
137: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">output_dir</span>)
|
368
|
+
138: <span class="ruby-identifier">puts</span> <span class="ruby-node">"Exists: #{output_dir}"</span>
|
369
|
+
139: <span class="ruby-keyword kw">return</span>
|
370
|
+
140: <span class="ruby-keyword kw">end</span>
|
371
|
+
141: <span class="ruby-identifier">mkdir_p</span>(<span class="ruby-identifier">output_dir</span>)
|
372
|
+
142: <span class="ruby-identifier">puts</span> <span class="ruby-node">"Created: #{output_dir}"</span>
|
373
|
+
143: <span class="ruby-keyword kw">end</span>
|
372
374
|
</pre>
|
373
375
|
</div>
|
374
376
|
</div>
|
@@ -391,23 +393,23 @@ This does the dirty work of generation.
|
|
391
393
|
onclick="toggleCode('M000015-source');return false;">[Source]</a></p>
|
392
394
|
<div class="method-source-code" id="M000015-source">
|
393
395
|
<pre>
|
394
|
-
<span class="ruby-comment cmt"># File lib/genosaurus.rb, line
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
396
|
+
<span class="ruby-comment cmt"># File lib/genosaurus.rb, line 152</span>
|
397
|
+
152: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">generate</span>
|
398
|
+
153: <span class="ruby-identifier">generate_callbacks</span> <span class="ruby-keyword kw">do</span>
|
399
|
+
154: <span class="ruby-identifier">manifest</span>.<span class="ruby-identifier">each_value</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">info</span><span class="ruby-operator">|</span>
|
400
|
+
155: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">info</span>[<span class="ruby-value str">"type"</span>]
|
401
|
+
156: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">"file"</span>
|
402
|
+
157: <span class="ruby-identifier">template</span>(<span class="ruby-identifier">info</span>[<span class="ruby-value str">"template_path"</span>], <span class="ruby-identifier">info</span>[<span class="ruby-value str">"output_path"</span>])
|
403
|
+
158: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">"directory"</span>
|
404
|
+
159: <span class="ruby-identifier">directory</span>(<span class="ruby-identifier">info</span>[<span class="ruby-value str">"output_path"</span>])
|
405
|
+
160: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">"copy"</span>
|
406
|
+
161: <span class="ruby-identifier">copy</span>(<span class="ruby-identifier">info</span>[<span class="ruby-value str">"template_path"</span>], <span class="ruby-identifier">info</span>[<span class="ruby-value str">"output_path"</span>])
|
407
|
+
162: <span class="ruby-keyword kw">else</span>
|
408
|
+
163: <span class="ruby-identifier">raise</span> <span class="ruby-node">"Unknown 'type': #{info["type"]}!"</span>
|
409
|
+
164: <span class="ruby-keyword kw">end</span>
|
410
|
+
165: <span class="ruby-keyword kw">end</span>
|
411
|
+
166: <span class="ruby-keyword kw">end</span>
|
412
|
+
167: <span class="ruby-keyword kw">end</span>
|
411
413
|
</pre>
|
412
414
|
</div>
|
413
415
|
</div>
|
@@ -438,31 +440,31 @@ href="Genosaurus.html#M000003">templates_directory_path</a>.
|
|
438
440
|
onclick="toggleCode('M000008-source');return false;">[Source]</a></p>
|
439
441
|
<div class="method-source-code" id="M000008-source">
|
440
442
|
<pre>
|
441
|
-
<span class="ruby-comment cmt"># File lib/genosaurus.rb, line
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
443
|
+
<span class="ruby-comment cmt"># File lib/genosaurus.rb, line 79</span>
|
444
|
+
79: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">manifest</span>
|
445
|
+
80: <span class="ruby-identifier">ivar_cache</span> <span class="ruby-keyword kw">do</span>
|
446
|
+
81: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">manifest_path</span>)
|
447
|
+
82: <span class="ruby-comment cmt"># run using the yml file</span>
|
448
|
+
83: <span class="ruby-identifier">template</span> = <span class="ruby-constant">ERB</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">manifest_path</span>).<span class="ruby-identifier">read</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-value str">"->"</span>)
|
449
|
+
84: <span class="ruby-identifier">man</span> = <span class="ruby-constant">YAML</span>.<span class="ruby-identifier">load</span>(<span class="ruby-identifier">template</span>.<span class="ruby-identifier">result</span>(<span class="ruby-identifier">binding</span>))
|
450
|
+
85: <span class="ruby-keyword kw">else</span>
|
451
|
+
86: <span class="ruby-identifier">files</span> = <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">glob</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">templates_directory_path</span>, <span class="ruby-value str">"**/*.template"</span>))
|
452
|
+
87: <span class="ruby-identifier">man</span> = {}
|
453
|
+
88: <span class="ruby-identifier">files</span>.<span class="ruby-identifier">each_with_index</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span>, <span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
|
454
|
+
89: <span class="ruby-identifier">output_path</span> = <span class="ruby-identifier">f</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-identifier">templates_directory_path</span>, <span class="ruby-value str">""</span>)
|
455
|
+
90: <span class="ruby-identifier">output_path</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-value str">".template"</span>, <span class="ruby-value str">""</span>)
|
456
|
+
91: <span class="ruby-identifier">output_path</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/^\//</span>, <span class="ruby-value str">""</span>)
|
457
|
+
92: <span class="ruby-identifier">man</span>[<span class="ruby-node">"template_#{i+1}"</span>] = {
|
458
|
+
93: <span class="ruby-value str">"type"</span> =<span class="ruby-operator">></span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">f</span>) <span class="ruby-operator">?</span> <span class="ruby-value str">"directory"</span> <span class="ruby-operator">:</span> <span class="ruby-value str">"file"</span>,
|
459
|
+
94: <span class="ruby-value str">"template_path"</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">f</span>,
|
460
|
+
95: <span class="ruby-value str">"output_path"</span> =<span class="ruby-operator">></span> <span class="ruby-constant">Erubis</span><span class="ruby-operator">::</span><span class="ruby-constant">Eruby</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">output_path</span>, <span class="ruby-identifier">:pattern</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'% %'</span>).<span class="ruby-identifier">result</span>(<span class="ruby-identifier">binding</span>)
|
461
|
+
96: }
|
462
|
+
97: <span class="ruby-keyword kw">end</span>
|
463
|
+
98: <span class="ruby-keyword kw">end</span>
|
464
|
+
99: <span class="ruby-comment cmt"># puts man.inspect</span>
|
465
|
+
100: <span class="ruby-identifier">man</span>
|
466
|
+
101: <span class="ruby-keyword kw">end</span>
|
467
|
+
102: <span class="ruby-keyword kw">end</span>
|
466
468
|
</pre>
|
467
469
|
</div>
|
468
470
|
</div>
|
@@ -492,10 +494,10 @@ return the correct path.
|
|
492
494
|
onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
|
493
495
|
<div class="method-source-code" id="M000004-source">
|
494
496
|
<pre>
|
495
|
-
<span class="ruby-comment cmt"># File lib/genosaurus.rb, line
|
496
|
-
|
497
|
-
|
498
|
-
|
497
|
+
<span class="ruby-comment cmt"># File lib/genosaurus.rb, line 57</span>
|
498
|
+
57: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">manifest_path</span>
|
499
|
+
58: <span class="ruby-ivar">@manifest_path</span>
|
500
|
+
59: <span class="ruby-keyword kw">end</span>
|
499
501
|
</pre>
|
500
502
|
</div>
|
501
503
|
</div>
|
@@ -515,12 +517,12 @@ return the correct path.
|
|
515
517
|
onclick="toggleCode('M000016-source');return false;">[Source]</a></p>
|
516
518
|
<div class="method-source-code" id="M000016-source">
|
517
519
|
<pre>
|
518
|
-
<span class="ruby-comment cmt"># File lib/genosaurus.rb, line
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
520
|
+
<span class="ruby-comment cmt"># File lib/genosaurus.rb, line 169</span>
|
521
|
+
169: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">method_missing</span>(<span class="ruby-identifier">sym</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
522
|
+
170: <span class="ruby-identifier">p</span> = <span class="ruby-identifier">param</span>(<span class="ruby-identifier">sym</span>)
|
523
|
+
171: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">p</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">p</span>
|
524
|
+
172: <span class="ruby-identifier">raise</span> <span class="ruby-constant">NoMethodError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">sym</span>)
|
525
|
+
173: <span class="ruby-keyword kw">end</span>
|
524
526
|
</pre>
|
525
527
|
</div>
|
526
528
|
</div>
|
@@ -543,10 +545,10 @@ Returns a parameter from the initial Hash of parameters.
|
|
543
545
|
onclick="toggleCode('M000011-source');return false;">[Source]</a></p>
|
544
546
|
<div class="method-source-code" id="M000011-source">
|
545
547
|
<pre>
|
546
|
-
<span class="ruby-comment cmt"># File lib/genosaurus.rb, line
|
547
|
-
|
548
|
-
|
549
|
-
|
548
|
+
<span class="ruby-comment cmt"># File lib/genosaurus.rb, line 116</span>
|
549
|
+
116: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">param</span>(<span class="ruby-identifier">key</span>)
|
550
|
+
117: (<span class="ruby-ivar">@options</span>[<span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">downcase</span>] <span class="ruby-operator">||=</span> <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">upcase</span>])
|
551
|
+
118: <span class="ruby-keyword kw">end</span>
|
550
552
|
</pre>
|
551
553
|
</div>
|
552
554
|
</div>
|
@@ -570,10 +572,10 @@ href="Genosaurus.html#M000005">setup</a> work needed by the generator.
|
|
570
572
|
onclick="toggleCode('M000005-source');return false;">[Source]</a></p>
|
571
573
|
<div class="method-source-code" id="M000005-source">
|
572
574
|
<pre>
|
573
|
-
<span class="ruby-comment cmt"># File lib/genosaurus.rb, line
|
574
|
-
|
575
|
-
|
576
|
-
|
575
|
+
<span class="ruby-comment cmt"># File lib/genosaurus.rb, line 62</span>
|
576
|
+
62: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">setup</span>
|
577
|
+
63: <span class="ruby-comment cmt"># does nothing, unless overridden in subclass.</span>
|
578
|
+
64: <span class="ruby-keyword kw">end</span>
|
577
579
|
</pre>
|
578
580
|
</div>
|
579
581
|
</div>
|
@@ -598,14 +600,14 @@ like to force the writing of the file, use the :force => true option.
|
|
598
600
|
onclick="toggleCode('M000012-source');return false;">[Source]</a></p>
|
599
601
|
<div class="method-source-code" id="M000012-source">
|
600
602
|
<pre>
|
601
|
-
<span class="ruby-comment cmt"># File lib/genosaurus.rb, line
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
603
|
+
<span class="ruby-comment cmt"># File lib/genosaurus.rb, line 124</span>
|
604
|
+
124: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">template</span>(<span class="ruby-identifier">input_file</span>, <span class="ruby-identifier">output_file</span>, <span class="ruby-identifier">options</span> = <span class="ruby-ivar">@options</span>)
|
605
|
+
125: <span class="ruby-identifier">output_file</span> = <span class="ruby-identifier">template_copy_common</span>(<span class="ruby-identifier">output_file</span>, <span class="ruby-identifier">options</span>)
|
606
|
+
126: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">output_file</span>.<span class="ruby-identifier">nil?</span>
|
607
|
+
127: <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">output_file</span>, <span class="ruby-value str">"w"</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">puts</span> <span class="ruby-constant">ERB</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">input_file</span>).<span class="ruby-identifier">read</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-value str">"->"</span>).<span class="ruby-identifier">result</span>(<span class="ruby-identifier">binding</span>)}
|
608
|
+
128: <span class="ruby-identifier">puts</span> <span class="ruby-node">"Wrote: #{output_file}"</span>
|
609
|
+
129: <span class="ruby-keyword kw">end</span>
|
610
|
+
130: <span class="ruby-keyword kw">end</span>
|
609
611
|
</pre>
|
610
612
|
</div>
|
611
613
|
</div>
|
@@ -634,10 +636,10 @@ return the correct path.
|
|
634
636
|
onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
|
635
637
|
<div class="method-source-code" id="M000003-source">
|
636
638
|
<pre>
|
637
|
-
<span class="ruby-comment cmt"># File lib/genosaurus.rb, line
|
638
|
-
|
639
|
-
|
640
|
-
|
639
|
+
<span class="ruby-comment cmt"># File lib/genosaurus.rb, line 49</span>
|
640
|
+
49: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">templates_directory_path</span>
|
641
|
+
50: <span class="ruby-ivar">@templates_directory_path</span>
|
642
|
+
51: <span class="ruby-keyword kw">end</span>
|
641
643
|
</pre>
|
642
644
|
</div>
|
643
645
|
</div>
|
data/doc/created.rid
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
Wed, 14 May 2008 23:56:19 -0400
|
data/doc/files/README.html
CHANGED
data/lib/genosaurus.rb
CHANGED
@@ -36,6 +36,8 @@ class Genosaurus
|
|
36
36
|
@templates_directory_path = File.join(File.dirname(f), "templates")
|
37
37
|
@manifest_path = File.join(File.dirname(f), "manifest.yml")
|
38
38
|
end
|
39
|
+
else
|
40
|
+
raise "Unable to dynamically figure out your templates_directory_path and manifest_path! Please implement these methods and let Genosaurus know where to find these things. Thanks."
|
39
41
|
end
|
40
42
|
setup
|
41
43
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: genosaurus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- markbates
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-05-
|
12
|
+
date: 2008-05-14 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -73,7 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
73
73
|
requirements: []
|
74
74
|
|
75
75
|
rubyforge_project: magrathea
|
76
|
-
rubygems_version: 1.
|
76
|
+
rubygems_version: 1.1.1
|
77
77
|
signing_key:
|
78
78
|
specification_version: 2
|
79
79
|
summary: genosaurus
|
@@ -87,11 +87,6 @@ test_files:
|
|
87
87
|
- test/lib/copy_machine_generator/templates/hello_world.txt
|
88
88
|
- test/lib/directory_generator
|
89
89
|
- test/lib/directory_generator/directory_generator.rb
|
90
|
-
- test/lib/directory_generator/templates
|
91
|
-
- test/lib/directory_generator/templates/months
|
92
|
-
- test/lib/directory_generator/templates/months/february.template
|
93
|
-
- test/lib/directory_generator/templates/months/january.template
|
94
|
-
- test/lib/directory_generator/templates/months/march.template
|
95
90
|
- test/lib/hello_goodbye_generator
|
96
91
|
- test/lib/hello_goodbye_generator/hello_goodbye_generator.rb
|
97
92
|
- test/lib/hello_goodbye_generator/templates
|
@@ -101,7 +96,6 @@ test_files:
|
|
101
96
|
- test/lib/i_am_the_walrus_generator/i_am_the_walrus_generator.rb
|
102
97
|
- test/lib/i_am_the_walrus_generator/templates
|
103
98
|
- test/lib/i_am_the_walrus_generator/templates/beatles
|
104
|
-
- test/lib/i_am_the_walrus_generator/templates/beatles/albums.template
|
105
99
|
- test/lib/i_am_the_walrus_generator/templates/beatles/lyrics
|
106
100
|
- test/lib/i_am_the_walrus_generator/templates/beatles/lyrics/%=name%.txt.template
|
107
101
|
- test/lib/strawberry_fields_generator
|