-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
17 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,23 +22,35 @@ class Petri | |
attr_reader :wiki | ||
attr_reader :release | ||
attr_reader :licensing | ||
attr_accessor :error | ||
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
Sorry, something went wrong.
EllaMartinez1981
|
||
|
||
def initialize(entry) | ||
key, hash = entry | ||
@id = key | ||
hash.each { |name, value| instance_variable_set("@#{name}", value) } | ||
end | ||
|
||
# Array of all active Petri culture entries | ||
# Array of all Petri culture entries | ||
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'] | ||
# Active cultures are listed under projects | ||
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| | ||
@list << new(yaml['cultures'][proj]) | ||
unless yaml['cultures'].include? proj | ||
@list << new([proj,{name: '', status: '', error: 'No culture entry found'}]) | ||
end | ||
end | ||
@list | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ella Intelligent Global Network Inc
https://ellaintelligentglobalnetwork.websites.co.in
By: Eloisa Martinez