You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by Sam Ruby <ru...@apache.org> on 2016/03/08 20:04:10 UTC

[whimsy.git] [1/1] Commit 099fe66: start the process of morphing Podlings into a class

Commit 099fe66a011b7b5c41b270b6ddd33519afc9e74f:
    start the process of morphing Podlings into a class
    with instance variables and everything.  As opposed to merely being a fancy
    wrapper for retrieving a hash.


Branch: refs/heads/master
Author: Sam Ruby <ru...@intertwingly.net>
Committer: Sam Ruby <ru...@intertwingly.net>
Pusher: rubys <ru...@apache.org>

------------------------------------------------------------
lib/whimsy/asf/podlings.rb                                   | + -
www/classic/roster/main.rb                                   | + -
www/roster/main.rb                                           | +++ ---
www/roster/public_nonldap_groups.rb                          | + -
------------------------------------------------------------
12 changes: 6 additions, 6 deletions.
------------------------------------------------------------


diff --git a/lib/whimsy/asf/podlings.rb b/lib/whimsy/asf/podlings.rb
index 7fcec5c..122ac9a 100644
--- a/lib/whimsy/asf/podlings.rb
+++ b/lib/whimsy/asf/podlings.rb
@@ -51,7 +51,7 @@ def self.to_enum
     end
 
     # return the entire list as a hash
-    def self.list
+    def self.to_h
       Hash[self.new.to_a]
     end
   end
diff --git a/www/classic/roster/main.rb b/www/classic/roster/main.rb
index aa9a9a1..396f530 100755
--- a/www/classic/roster/main.rb
+++ b/www/classic/roster/main.rb
@@ -79,7 +79,7 @@
 
 get '/json/podlings' do
   _json do
-    _! Hash[ASF::Podlings.new.map {|podling, definition| [podling, definition]}]
+    _! ASF::Podlings.to_h
   end
 end
 
diff --git a/www/roster/main.rb b/www/roster/main.rb
index 1ea8f2e..ec7fc64 100755
--- a/www/roster/main.rb
+++ b/www/roster/main.rb
@@ -28,7 +28,7 @@
     @committees = ASF::Committee.list
     @members = ASF::Member.list.keys - ASF::Member.status.keys
     @groups = Group.list
-    @podlings = ASF::Podlings.new.to_h.values
+    @podlings = ASF::Podlings.to_h.values
     _html :index
   else
     redirect to('/')
@@ -105,7 +105,7 @@
 
 get '/group/' do
   @groups = Group.list
-  @podlings = ASF::Podlings.new.to_h
+  @podlings = ASF::Podlings.to_h
   _html :groups
 end
 
@@ -123,7 +123,7 @@
   attic = ASF::SVN['asf/attic/site/xdocs/projects']
   @attic = Dir["#{attic}/*.xml"].map {|file| File.basename(file, '.xml')}
   @committees = ASF::Committee.list.map(&:id)
-  @podlings = ASF::Podlings.new.to_a.map {|id, hash| hash.merge id: id}
+  @podlings = ASF::Podlings.to_enum.map {|id, hash| hash.merge id: id}
 
   _html :podlings
 end
diff --git a/www/roster/public_nonldap_groups.rb b/www/roster/public_nonldap_groups.rb
index e7f7376..9741cb5 100644
--- a/www/roster/public_nonldap_groups.rb
+++ b/www/roster/public_nonldap_groups.rb
@@ -23,7 +23,7 @@
 require_relative 'public_json_common'
 
 require 'net/http'
-pods = Hash[ASF::Podlings.new.map {|podling, definition| [podling, definition[:status]]}]
+pods = Hash[ASF::Podlings.to_enum.map {|podling, definition| [podling, definition[:status]]}]
 
 file = '/apache/infrastructure-puppet/deployment/modules/subversion_server/files/authorization/asf-authorization-template'
 http = Net::HTTP.new('raw.githubusercontent.com', 443)