]> git.donarmstrong.com Git - biopieces.git/blobdiff - code_ruby/Maasha/lib/biopieces.rb
ruby unit tests refactored
[biopieces.git] / code_ruby / Maasha / lib / biopieces.rb
index 2828a4211f1c487f3aa5c1a59a5d8e91f81b7e35..b739ee7d4c1a1ea6d78368e6ce50e8b36f42d419 100644 (file)
@@ -6,17 +6,15 @@ require 'pp'
 class CastError < StandardError
 end
 
-# Class using for handling Biopieces the parsing and emitting of Biopiece records,
-# which are ASCII text records consisting of lines with a key/value pair seperated
-# by a colon and a white space ': '. Each record is separated by a line with three
-# dashes '---'.
-# 
 # Biopieces are command line scripts and uses OptionParser to parse command line
 # options according to a list of casts. Each cast prescribes the long and short
 # name of the option, the type, if it is mandatory, the default value, and allowed
 # and disallowed values. An optional list of extra casts can be supplied, and the
 # integrity of the casts are checked. Following the command line parsing, the
-# options are checked according to the casts.
+# options are checked according to the casts. Methods are also included for handling
+# the parsing and emitting of Biopiece records, which are ASCII text records consisting
+# of lines with a key/value pair seperated by a colon and a white space ': '.
+# Each record is separated by a line with three dashes '---'.
 class Biopieces
   TYPES        = %w[flag string list int uint float file file! files files! dir dir! genome]
   MANDATORY    = %w[long short type mandatory default allowed disallowed]
@@ -25,8 +23,8 @@ class Biopieces
   REGEX_STRING = /^(string|file|file!|dir|dir!|genome)$/
 
   # Initialize a Biopiece and write the status to file.
-  def initialize
-    status_set
+  def initialize(no_status=nil)
+    status_set unless no_status
   end
 
   # Check the integrity of a list of casts, followed by parsion options from argv