def process( answers_hash={}, items_yaml = nil )
@answers_hash = answers_hash
rb_files = File.expand_path( '../config/item/*.rb', File.dirname(__FILE__))
Dir.glob( rb_files ).sort_by(&:to_s).each { |file| require file }
if items_yaml.nil?
case @answers_hash.fetch('cli::simp::scenario')
when 'simp', 'simp-lite'
items_yaml = create_simp_item_factory_yaml(false)
when 'poss'
items_yaml = create_simp_item_factory_yaml(true)
else
raise "ERROR: Unsupported scenario '#{@answers_hash['cli::simp::scenario']}'"
end
end
begin
items = YAML.load items_yaml
rescue Psych::SyntaxError => e
$stderr.puts "Invalid Items list YAML: #{e.message}"
$stderr.puts '>'*80
$stderr.puts items_yaml
$stderr.puts '<'*80
raise 'Internal error: invalid Items list YAML'
end
item_queue = build_item_queue( [], items )
item_queue
end