class ASF::Petri
Attributes
Public Class Methods
Source
# File lib/whimsy/asf/petri.rb, line 34 def self.list @list = [] response = Net::HTTP.get_response(URI(PETRI_INFO)) response.value() # Raises error if not OK yaml = YAML.safe_load(response.body, permitted_classes: [Symbol]) # @mentors = yaml['mentors'] yaml['cultures'].each do |proj| prj = new(proj) if yaml['projects'].include? proj prj.error = 'Listed as a current project' unless prj.status == 'current' else prj.error = 'Not listed as a current project' if prj.status == 'current' end @list << prj end # Now check against projects listing yaml['projects'].each do |proj| unless yaml['cultures'].include? proj @list << new([proj,{name: '', status: '', error: 'No culture entry found'}]) end end @list end
Array of all Petri
culture entries
Source
# File lib/whimsy/asf/petri.rb, line 27 def initialize(entry) key, hash = entry @id = key hash.each { |name, value| instance_variable_set("@#{name}", value) } end