summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xprojects.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/projects.rb b/projects.rb
index 45d121b..c922a5c 100755
--- a/projects.rb
+++ b/projects.rb
@@ -34,11 +34,12 @@ def query_members(project_uri)
Query.new do
pattern [RDF::URI.new(project_uri), GentooWiki::SUBOBJECT, :member_subobj_uri]
pattern [:member_subobj_uri, GentooWiki::PROP_DEV, :member_uri]
- pattern [:member_subobj_uri, GentooWiki::PROP_ROLE, :member_roles]
pattern [:member_subobj_uri, GentooWiki::PROP_LEAD, :member_is_lead]
pattern [:member_uri, GentooWiki::PROP_NICK, :member_nick]
pattern [:member_uri, GentooWiki::PROP_NAME, :member_name]
pattern [:member_uri, GentooWiki::PROP_CONTACT, :member_email]
+
+ pattern [:member_subobj_uri, GentooWiki::PROP_ROLE, :member_roles], optional: true
end
end
@@ -72,13 +73,15 @@ projects_q.execute(graph) do |result|
project['members'] = []
query_members(result[:proj_uri]).execute(graph) do |member_result|
- project['members'] << {
+ member_hash = {
'nickname' => member_result[:member_nick].to_s,
- 'role' => member_result[:member_roles].to_s,
'is_lead' => member_result[:member_is_lead].to_s == 'true',
'email' => email(member_result[:member_email].to_s),
'name' => member_result[:member_name].to_s
}
+
+ member_hash['role'] = member_result[:member_roles].to_s if member_result.key? :member_roles
+ project['members'] << member_hash
end
projects[project_id] = project