genosaurus 1.1.3 → 1.1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -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 141</span>
333
- 141: <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
- 142: <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
- 143: <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
- 144: <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Copied: #{output_file}&quot;</span>
337
- 145: <span class="ruby-keyword kw">end</span>
332
+ <span class="ruby-comment cmt"># File lib/genosaurus.rb, line 143</span>
333
+ 143: <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
+ 144: <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
+ 145: <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
+ 146: <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Copied: #{output_file}&quot;</span>
337
+ 147: <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 129</span>
361
- 129: <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
- 130: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$genosaurus_output_directory</span>
363
- 131: <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
- 132: <span class="ruby-keyword kw">end</span>
365
- 133: <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
- 134: <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Exists: #{output_dir}&quot;</span>
367
- 135: <span class="ruby-keyword kw">return</span>
368
- 136: <span class="ruby-keyword kw">end</span>
369
- 137: <span class="ruby-identifier">mkdir_p</span>(<span class="ruby-identifier">output_dir</span>)
370
- 138: <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Created: #{output_dir}&quot;</span>
371
- 139: <span class="ruby-keyword kw">end</span>
360
+ <span class="ruby-comment cmt"># File lib/genosaurus.rb, line 131</span>
361
+ 131: <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
+ 132: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$genosaurus_output_directory</span>
363
+ 133: <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
+ 134: <span class="ruby-keyword kw">end</span>
365
+ 135: <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
+ 136: <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Exists: #{output_dir}&quot;</span>
367
+ 137: <span class="ruby-keyword kw">return</span>
368
+ 138: <span class="ruby-keyword kw">end</span>
369
+ 139: <span class="ruby-identifier">mkdir_p</span>(<span class="ruby-identifier">output_dir</span>)
370
+ 140: <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Created: #{output_dir}&quot;</span>
371
+ 141: <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 148</span>
395
- 148: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">generate</span>
396
- 149: <span class="ruby-identifier">generate_callbacks</span> <span class="ruby-keyword kw">do</span>
397
- 150: <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
- 151: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">info</span>[<span class="ruby-value str">&quot;type&quot;</span>]
399
- 152: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;file&quot;</span>
400
- 153: <span class="ruby-identifier">template</span>(<span class="ruby-identifier">info</span>[<span class="ruby-value str">&quot;template_path&quot;</span>], <span class="ruby-identifier">info</span>[<span class="ruby-value str">&quot;output_path&quot;</span>])
401
- 154: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;directory&quot;</span>
402
- 155: <span class="ruby-identifier">directory</span>(<span class="ruby-identifier">info</span>[<span class="ruby-value str">&quot;output_path&quot;</span>])
403
- 156: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;copy&quot;</span>
404
- 157: <span class="ruby-identifier">copy</span>(<span class="ruby-identifier">info</span>[<span class="ruby-value str">&quot;template_path&quot;</span>], <span class="ruby-identifier">info</span>[<span class="ruby-value str">&quot;output_path&quot;</span>])
405
- 158: <span class="ruby-keyword kw">else</span>
406
- 159: <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Unknown 'type': #{info[&quot;type&quot;]}!&quot;</span>
407
- 160: <span class="ruby-keyword kw">end</span>
408
- 161: <span class="ruby-keyword kw">end</span>
409
- 162: <span class="ruby-keyword kw">end</span>
410
- 163: <span class="ruby-keyword kw">end</span>
394
+ <span class="ruby-comment cmt"># File lib/genosaurus.rb, line 150</span>
395
+ 150: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">generate</span>
396
+ 151: <span class="ruby-identifier">generate_callbacks</span> <span class="ruby-keyword kw">do</span>
397
+ 152: <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
+ 153: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">info</span>[<span class="ruby-value str">&quot;type&quot;</span>]
399
+ 154: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;file&quot;</span>
400
+ 155: <span class="ruby-identifier">template</span>(<span class="ruby-identifier">info</span>[<span class="ruby-value str">&quot;template_path&quot;</span>], <span class="ruby-identifier">info</span>[<span class="ruby-value str">&quot;output_path&quot;</span>])
401
+ 156: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;directory&quot;</span>
402
+ 157: <span class="ruby-identifier">directory</span>(<span class="ruby-identifier">info</span>[<span class="ruby-value str">&quot;output_path&quot;</span>])
403
+ 158: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;copy&quot;</span>
404
+ 159: <span class="ruby-identifier">copy</span>(<span class="ruby-identifier">info</span>[<span class="ruby-value str">&quot;template_path&quot;</span>], <span class="ruby-identifier">info</span>[<span class="ruby-value str">&quot;output_path&quot;</span>])
405
+ 160: <span class="ruby-keyword kw">else</span>
406
+ 161: <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Unknown 'type': #{info[&quot;type&quot;]}!&quot;</span>
407
+ 162: <span class="ruby-keyword kw">end</span>
408
+ 163: <span class="ruby-keyword kw">end</span>
409
+ 164: <span class="ruby-keyword kw">end</span>
410
+ 165: <span class="ruby-keyword kw">end</span>
411
411
  </pre>
412
412
  </div>
413
413
  </div>
@@ -515,12 +515,12 @@ return the correct path.
515
515
  onclick="toggleCode('M000016-source');return false;">[Source]</a></p>
516
516
  <div class="method-source-code" id="M000016-source">
517
517
  <pre>
518
- <span class="ruby-comment cmt"># File lib/genosaurus.rb, line 165</span>
519
- 165: <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>)
520
- 166: <span class="ruby-identifier">p</span> = <span class="ruby-identifier">param</span>(<span class="ruby-identifier">sym</span>)
521
- 167: <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>
522
- 168: <span class="ruby-identifier">raise</span> <span class="ruby-constant">NoMethodError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">sym</span>)
523
- 169: <span class="ruby-keyword kw">end</span>
518
+ <span class="ruby-comment cmt"># File lib/genosaurus.rb, line 167</span>
519
+ 167: <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>)
520
+ 168: <span class="ruby-identifier">p</span> = <span class="ruby-identifier">param</span>(<span class="ruby-identifier">sym</span>)
521
+ 169: <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>
522
+ 170: <span class="ruby-identifier">raise</span> <span class="ruby-constant">NoMethodError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">sym</span>)
523
+ 171: <span class="ruby-keyword kw">end</span>
524
524
  </pre>
525
525
  </div>
526
526
  </div>
@@ -601,9 +601,11 @@ like to force the writing of the file, use the :force =&gt; true option.
601
601
  <span class="ruby-comment cmt"># File lib/genosaurus.rb, line 122</span>
602
602
  122: <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>)
603
603
  123: <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>)
604
- 124: <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">output_file</span>, <span class="ruby-value str">&quot;w&quot;</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">&quot;-&gt;&quot;</span>).<span class="ruby-identifier">result</span>(<span class="ruby-identifier">binding</span>)}
605
- 125: <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Wrote: #{output_file}&quot;</span>
606
- 126: <span class="ruby-keyword kw">end</span>
604
+ 124: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">output_file</span>.<span class="ruby-identifier">nil?</span>
605
+ 125: <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">output_file</span>, <span class="ruby-value str">&quot;w&quot;</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">&quot;-&gt;&quot;</span>).<span class="ruby-identifier">result</span>(<span class="ruby-identifier">binding</span>)}
606
+ 126: <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Wrote: #{output_file}&quot;</span>
607
+ 127: <span class="ruby-keyword kw">end</span>
608
+ 128: <span class="ruby-keyword kw">end</span>
607
609
  </pre>
608
610
  </div>
609
611
  </div>
data/doc/created.rid CHANGED
@@ -1 +1 @@
1
- Mon, 28 Apr 2008 14:44:38 -0400
1
+ Mon, 05 May 2008 15:30:32 -0400
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Mon Apr 28 14:32:28 -0400 2008</td>
59
+ <td>Mon May 05 11:31:14 -0400 2008</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Mon Apr 28 14:43:45 -0400 2008</td>
59
+ <td>Mon May 05 15:30:14 -0400 2008</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
data/lib/genosaurus.rb CHANGED
@@ -121,8 +121,10 @@ class Genosaurus
121
121
  # :force => true option.
122
122
  def template(input_file, output_file, options = @options)
123
123
  output_file = template_copy_common(output_file, options)
124
- File.open(output_file, "w") {|f| f.puts ERB.new(File.open(input_file).read, nil, "->").result(binding)}
125
- puts "Wrote: #{output_file}"
124
+ unless output_file.nil?
125
+ File.open(output_file, "w") {|f| f.puts ERB.new(File.open(input_file).read, nil, "->").result(binding)}
126
+ puts "Wrote: #{output_file}"
127
+ end
126
128
  end
127
129
 
128
130
  # Creates the specified directory.
@@ -179,7 +181,7 @@ class Genosaurus
179
181
  if File.exists?(output_file)
180
182
  unless options[:force]
181
183
  puts "Skipped: #{output_file}"
182
- return
184
+ return nil
183
185
  end
184
186
  end
185
187
  # incase the directory doesn't exist, let's create it.
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.3
4
+ version: 1.1.4
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-04-28 00:00:00 -04:00
12
+ date: 2008-05-05 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency