lib/sushi_fabric/sushiApp.rb in sushi_fabric-0.1.3 vs lib/sushi_fabric/sushiApp.rb in sushi_fabric-0.1.4
- old
+ new
@@ -1,8 +1,8 @@
#!/usr/bin/env ruby
# encoding: utf-8
-# Version = '20140228-143416'
+# Version = '20140313-152005'
require 'csv'
require 'fileutils'
require 'yaml'
require 'drb/drb'
@@ -209,10 +209,26 @@
#@factor_cols = @dataset_hash.first.keys.select{|header| header =~ /\[#{tag}\]/}.map{|header| header.gsub(/\[.+\]/,'').strip}
@dataset_hash.map{|row|
Hash[*row.select{|k,v| k=~/\[#{tag}\]/}.map{|k,v| [k.gsub(/\[.+\]/,'').strip,v]}.flatten]
}
end
+ def set_default_parameters
+ # this should be overwritten in a subclass
+ end
+ def dataset_has_column?(colname)
+ flag = false
+ @dataset_hash.map{|sample|
+ sample.each do |key, value|
+ if key =~ /#{colname}/
+ flag = true
+ end
+ end
+ break
+ }
+ flag
+ end
+
def set_output_files
@dataset = {}
next_dataset.keys.select{|header| header.tag?('File')}.each do |header|
@output_files ||= []
@output_files << header
@@ -693,22 +709,9 @@
puts "\e[31mFailures (#{failures})\e[0m: All failures should be solved"
raise "test run fails"
else
puts "All checks \e[32mPASSED\e[0m"
end
- end
- def builder_selector(base_dir, shown_pattern=nil)
- selector = {}
- Dir[base_dir].sort.select{|dir| File.directory?(dir)}.each do |dir|
- key = if shown_pattern
- dir.gsub(shown_pattern.keys.first,shown_pattern)
- else
- dir
- end
- value = File.basename(dir)
- selector[key] = value
- end
- selector
end
end
end