Permalink
Browse files

added --uuid parameter

  • Loading branch information...
fstrozzi committed Oct 9, 2012
1 parent 62200a7 commit 6957d5a729ac3fe7604e23fe41f32f95bed187fe
Showing with 8 additions and 4 deletions.
  1. +4 −0 bin/bio-grid
  2. +4 −4 lib/bio/grid.rb
View
@@ -56,6 +56,10 @@ optparse = OptionParser.new do |opts|
options[:sep] = sep
end
+ opts.on("--uuid UUID","Provide a UUID for the job array") do |uuid|
+ options[:uuid] = uuid
+ end
+
opts.on("--keep-scripts","Keep all the running scripts created for all the jobs") {options[:keep] = true}
opts.on("-h","--help","Display this screen") do
View
@@ -3,16 +3,16 @@ module Bio
class Grid
attr_accessor :input,:number,:uuid
- def initialize(input,number)
+ def initialize(input,number, uuid)
@input = input
@number = number
- @uuid = UUID.new.generate.split("-").first
+ @uuid = (options[:uuid]) ? options[:uuid] : UUID.new.generate.split("-").first
end
def self.run(options)
options[:number] = "all" unless options[:number]
- grid = self.new options[:input], options[:number]
- options[:uuid] = grid.uuid
+ grid = self.new options[:input], options[:number], options[:uuid]
+ options[:uuid] = grid.uuid unless options[:uuid]
groups = grid.prepare_input_groups
inputs = groups.keys.sort
groups[inputs.shift].each_with_index do |input1,index|

0 comments on commit 6957d5a

Please sign in to comment.