# File lib/genome-lib/lib.rb, line 83 def facts_for(type) # Don't want to pull in the genome lib. See below fore more detail. facts = GenomeLib::restr_get("#{@genomed}/machine_types/#{type}.xml", "fact") return (!facts or facts.empty?) ? {} : facts.map do |f| def f.name self["name"] end def f.desc self["description"] end # Here's where we make use of the DSL's simple templating f.instance_variable_set(:@repo, @repo) def f.default # handle there case where there is no default self["default"].gsub("%repo%", @repo) rescue "" end f end end