module ParallelTests::Tasks

def parse_args(args)

parallel:spec[:count, :pattern, :options, :pass_through]
def parse_args(args)
  # order as given by user
  args = [args[:count], args[:pattern], args[:options], args[:pass_through]]
  # count given or empty ?
  # parallel:spec[2,models,options]
  # parallel:spec[,models,options]
  count = args.shift if args.first.to_s =~ /^\d*$/
  num_processes = count.to_i unless count.to_s.empty?
  pattern = args.shift
  options = args.shift
  pass_through = args.shift
  [num_processes, pattern.to_s, options.to_s, pass_through.to_s]
end