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 693772b4 Add some utility methods for all podlings
693772b4 is described below
commit 693772b47db2fc5afa285d3bf21f85ea187605f1
Author: Sebb <[email protected]>
AuthorDate: Mon Jul 14 15:29:36 2025 +0100
Add some utility methods for all podlings
---
lib/whimsy/asf/podling.rb | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/lib/whimsy/asf/podling.rb b/lib/whimsy/asf/podling.rb
index f791044c..c6581feb 100644
--- a/lib/whimsy/asf/podling.rb
+++ b/lib/whimsy/asf/podling.rb
@@ -198,6 +198,11 @@ module ASF
@list
end
+ # hash of podlings with status
+ def self.list_with_status
+ self.list.map {|pod| [pod.id, pod.status]}.to_h
+ end
+
# list of current podlings
def self.current
self._list('current')
@@ -228,6 +233,16 @@ module ASF
self._listids('retired')
end
+ # list of all podlings
+ def self.all
+ self._list('all')
+ end
+
+ # list of all podling ids
+ def self.allids
+ self._listids('all')
+ end
+
# last modified time of podlings.xml in the local working directory,
# as of the last time #list was called.
def self.mtime
@@ -491,11 +506,11 @@ module ASF
private
def self._list(status)
- list.select { |podling| podling.status == status }
+ list.select { |podling| status == 'all' or podling.status == status }
end
def self._listids(status)
- list.select { |podling| podling.status == status }.map(&:id)
+ self._list(status).map(&:id)
end
end
end