This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push:
new 1ecbc9e Basic Petri access
1ecbc9e is described below
commit 1ecbc9e6af74adfe3674f39d03efa9081ee5c4a0
Author: Sebb <[email protected]>
AuthorDate: Mon Mar 8 17:30:24 2021 +0000
Basic Petri access
---
lib/whimsy/asf.rb | 1 +
lib/whimsy/asf/petri.rb | 42 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 43 insertions(+)
diff --git a/lib/whimsy/asf.rb b/lib/whimsy/asf.rb
index e37c9cd..0ebadbc 100644
--- a/lib/whimsy/asf.rb
+++ b/lib/whimsy/asf.rb
@@ -10,6 +10,7 @@ require_relative 'asf/icla'
require_relative 'asf/documents'
require_relative 'asf/auth'
require_relative 'asf/member'
+require_relative 'asf/petri'
require_relative 'asf/podling'
require_relative 'asf/person'
require_relative 'asf/themes'
diff --git a/lib/whimsy/asf/petri.rb b/lib/whimsy/asf/petri.rb
new file mode 100644
index 0000000..3a9f2c6
--- /dev/null
+++ b/lib/whimsy/asf/petri.rb
@@ -0,0 +1,42 @@
+require 'yaml'
+require_relative 'git'
+
+module ASF
+
+ # Represents a Petri culture
+ # currently defined only in
+ # https://github.com/apache/petri/blob/master/info.yaml
+
+ # Initial very basic implementation.
+
+ PETRI_INFO = '/apache/petri/master/info.yaml'
+
+ class Petri
+ include Enumerable
+
+ attr_reader :name
+
+ attr_reader :description
+
+ def initialize(entry)
+ @name = entry # currently only the name is provided
+ end
+
+ # Array of all Petri culture entries
+ def self.list
+ @list = []
+ yaml = YAML.safe_load(ASF::Git.github(PETRI_INFO))
+ # @mentors = yaml['mentors']
+ yaml['projects'].each do |proj|
+ @list << new(proj)
+ end
+ @list
+ end
+ end
+end
+
+if __FILE__ == $0
+ ASF::Petri.list.each do |e|
+ p e.name
+ end
+end
\ No newline at end of file