genosaurus 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/doc/classes/Genosaurus.html +46 -45
- 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 +3 -2
- metadata +4 -3
data/doc/classes/Genosaurus.html
CHANGED
@@ -329,12 +329,12 @@ href="Genosaurus.html#M000001">run</a>.
|
|
329
329
|
onclick="toggleCode('M000014-source');return false;">[Source]</a></p>
|
330
330
|
<div class="method-source-code" id="M000014-source">
|
331
331
|
<pre>
|
332
|
-
<span class="ruby-comment cmt"># File lib/genosaurus.rb, line
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
332
|
+
<span class="ruby-comment cmt"># File lib/genosaurus.rb, line 155</span>
|
333
|
+
155: <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>)
|
334
|
+
156: <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>)
|
335
|
+
157: <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>)
|
336
|
+
158: <span class="ruby-identifier">puts</span> <span class="ruby-node">"Copied: #{output_file}"</span>
|
337
|
+
159: <span class="ruby-keyword kw">end</span>
|
338
338
|
</pre>
|
339
339
|
</div>
|
340
340
|
</div>
|
@@ -357,18 +357,18 @@ Creates the specified <a href="Genosaurus.html#M000013">directory</a>.
|
|
357
357
|
onclick="toggleCode('M000013-source');return false;">[Source]</a></p>
|
358
358
|
<div class="method-source-code" id="M000013-source">
|
359
359
|
<pre>
|
360
|
-
<span class="ruby-comment cmt"># File lib/genosaurus.rb, line
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
360
|
+
<span class="ruby-comment cmt"># File lib/genosaurus.rb, line 143</span>
|
361
|
+
143: <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>)
|
362
|
+
144: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$genosaurus_output_directory</span>
|
363
|
+
145: <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>)
|
364
|
+
146: <span class="ruby-keyword kw">end</span>
|
365
|
+
147: <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>)
|
366
|
+
148: <span class="ruby-identifier">puts</span> <span class="ruby-node">"Exists: #{output_dir}"</span>
|
367
|
+
149: <span class="ruby-keyword kw">return</span>
|
368
|
+
150: <span class="ruby-keyword kw">end</span>
|
369
|
+
151: <span class="ruby-identifier">mkdir_p</span>(<span class="ruby-identifier">output_dir</span>)
|
370
|
+
152: <span class="ruby-identifier">puts</span> <span class="ruby-node">"Created: #{output_dir}"</span>
|
371
|
+
153: <span class="ruby-keyword kw">end</span>
|
372
372
|
</pre>
|
373
373
|
</div>
|
374
374
|
</div>
|
@@ -391,23 +391,23 @@ This does the dirty work of generation.
|
|
391
391
|
onclick="toggleCode('M000015-source');return false;">[Source]</a></p>
|
392
392
|
<div class="method-source-code" id="M000015-source">
|
393
393
|
<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
|
-
|
394
|
+
<span class="ruby-comment cmt"># File lib/genosaurus.rb, line 162</span>
|
395
|
+
162: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">generate</span>
|
396
|
+
163: <span class="ruby-identifier">generate_callbacks</span> <span class="ruby-keyword kw">do</span>
|
397
|
+
164: <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>
|
398
|
+
165: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">info</span>[<span class="ruby-value str">"type"</span>]
|
399
|
+
166: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">"file"</span>
|
400
|
+
167: <span class="ruby-identifier">template</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">info</span>[<span class="ruby-value str">"template_path"</span>]).<span class="ruby-identifier">read</span>, <span class="ruby-identifier">info</span>[<span class="ruby-value str">"output_path"</span>])
|
401
|
+
168: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">"directory"</span>
|
402
|
+
169: <span class="ruby-identifier">directory</span>(<span class="ruby-identifier">info</span>[<span class="ruby-value str">"output_path"</span>])
|
403
|
+
170: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">"copy"</span>
|
404
|
+
171: <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>])
|
405
|
+
172: <span class="ruby-keyword kw">else</span>
|
406
|
+
173: <span class="ruby-identifier">raise</span> <span class="ruby-node">"Unknown 'type': #{info["type"]}!"</span>
|
407
|
+
174: <span class="ruby-keyword kw">end</span>
|
408
|
+
175: <span class="ruby-keyword kw">end</span>
|
409
|
+
176: <span class="ruby-keyword kw">end</span>
|
410
|
+
177: <span class="ruby-keyword kw">end</span>
|
411
411
|
</pre>
|
412
412
|
</div>
|
413
413
|
</div>
|
@@ -516,12 +516,12 @@ return the correct path.
|
|
516
516
|
onclick="toggleCode('M000016-source');return false;">[Source]</a></p>
|
517
517
|
<div class="method-source-code" id="M000016-source">
|
518
518
|
<pre>
|
519
|
-
<span class="ruby-comment cmt"># File lib/genosaurus.rb, line
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
519
|
+
<span class="ruby-comment cmt"># File lib/genosaurus.rb, line 179</span>
|
520
|
+
179: <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>)
|
521
|
+
180: <span class="ruby-identifier">p</span> = <span class="ruby-identifier">param</span>(<span class="ruby-identifier">sym</span>)
|
522
|
+
181: <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>
|
523
|
+
182: <span class="ruby-identifier">raise</span> <span class="ruby-constant">NoMethodError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">sym</span>)
|
524
|
+
183: <span class="ruby-keyword kw">end</span>
|
525
525
|
</pre>
|
526
526
|
</div>
|
527
527
|
</div>
|
@@ -603,10 +603,11 @@ like to force the writing of the file, use the :force => true option.
|
|
603
603
|
133: <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>)
|
604
604
|
134: <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>)
|
605
605
|
135: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">output_file</span>.<span class="ruby-identifier">nil?</span>
|
606
|
-
136: <span class="ruby-
|
607
|
-
137: <span class="ruby-identifier">
|
608
|
-
138:
|
609
|
-
139:
|
606
|
+
136: <span class="ruby-comment cmt"># File.open(output_file, "w") {|f| f.puts ERB.new(File.open(input_file).read, nil, "->").result(binding)}</span>
|
607
|
+
137: <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-identifier">input_file</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
|
+
138: <span class="ruby-identifier">puts</span> <span class="ruby-node">"Wrote: #{output_file}"</span>
|
609
|
+
139: <span class="ruby-keyword kw">end</span>
|
610
|
+
140: <span class="ruby-keyword kw">end</span>
|
610
611
|
</pre>
|
611
612
|
</div>
|
612
613
|
</div>
|
data/doc/created.rid
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
Mon, 04 Aug 2008 17:05:59 -0400
|
data/doc/files/README.html
CHANGED
data/lib/genosaurus.rb
CHANGED
@@ -133,7 +133,8 @@ class Genosaurus
|
|
133
133
|
def template(input_file, output_file, options = @options)
|
134
134
|
output_file = template_copy_common(output_file, options)
|
135
135
|
unless output_file.nil?
|
136
|
-
File.open(output_file, "w") {|f| f.puts ERB.new(File.open(input_file).read, nil, "->").result(binding)}
|
136
|
+
# File.open(output_file, "w") {|f| f.puts ERB.new(File.open(input_file).read, nil, "->").result(binding)}
|
137
|
+
File.open(output_file, "w") {|f| f.puts ERB.new(input_file, nil, "->").result(binding)}
|
137
138
|
puts "Wrote: #{output_file}"
|
138
139
|
end
|
139
140
|
end
|
@@ -163,7 +164,7 @@ class Genosaurus
|
|
163
164
|
manifest.each_value do |info|
|
164
165
|
case info["type"]
|
165
166
|
when "file"
|
166
|
-
template(info["template_path"], info["output_path"])
|
167
|
+
template(File.open(info["template_path"]).read, info["output_path"])
|
167
168
|
when "directory"
|
168
169
|
directory(info["output_path"])
|
169
170
|
when "copy"
|
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.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- markbates
|
@@ -9,11 +9,12 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-08-04 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: erubis
|
17
|
+
type: :runtime
|
17
18
|
version_requirement:
|
18
19
|
version_requirements: !ruby/object:Gem::Requirement
|
19
20
|
requirements:
|
@@ -65,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
65
66
|
requirements: []
|
66
67
|
|
67
68
|
rubyforge_project: magrathea
|
68
|
-
rubygems_version: 1.
|
69
|
+
rubygems_version: 1.2.0
|
69
70
|
signing_key:
|
70
71
|
specification_version: 2
|
71
72
|
summary: genosaurus
|