]> git.donarmstrong.com Git - biopieces.git/blobdiff - code_ruby/lib/maasha/biopieces.rb
refactor foo to record
[biopieces.git] / code_ruby / lib / maasha / biopieces.rb
index 1797d9211ed4e16ddcc1101b86d1170437ae314f..f18bd90aa2e9da46363571c388b4f52f9807a096 100644 (file)
@@ -31,6 +31,8 @@ require 'pp'
 require 'stringio'
 require 'zlib'
 
+BEGIN { Dir.mkdir ENV["BP_TMP"] unless File.directory? ENV["BP_TMP"] }
+
 TEST = false
 
 # Monkey patch (evil) changing the to_s method of the Hash class to
@@ -82,7 +84,7 @@ class Biopieces
     io_in  = self.open_input(input)
     io_out = self.open_output(output)
 
-    if block_given?
+    if block_given?   # FIXME begin block outmost?
       begin
         yield io_in, io_out
       ensure
@@ -112,8 +114,8 @@ class Biopieces
   end
 
   # Method to write a Biopiece record to _ios_.
-  def puts(foo)
-    @ios << foo.to_s
+  def puts(record)
+    @ios << record.to_s
   end
 
   # Method to close _ios_.