whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject [whimsy] branch master updated: cleanup module ASF rdoc
Date Sat, 17 Jun 2017 15:25:08 GMT
This is an automated email from the ASF dual-hosted git repository.

rubys 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 d968fa3  cleanup module ASF rdoc
d968fa3 is described below

commit d968fa39792d9882f3e714051e836a9ac72cf36a
Author: Sam Ruby <rubys@intertwingly.net>
AuthorDate: Sat Jun 17 11:24:54 2017 -0400

    cleanup module ASF rdoc
---
 lib/whimsy/asf.rb          | 10 ++++++++++
 lib/whimsy/asf/ldap.rb     | 21 ++++++++++++++-------
 lib/whimsy/asf/orgchart.rb |  2 +-
 3 files changed, 25 insertions(+), 8 deletions(-)

diff --git a/lib/whimsy/asf.rb b/lib/whimsy/asf.rb
index 7a0b447..85a1f2e 100644
--- a/lib/whimsy/asf.rb
+++ b/lib/whimsy/asf.rb
@@ -14,7 +14,16 @@ require_relative 'asf/podlings'
 require_relative 'asf/person'
 require_relative 'asf/themes'
 
+#
+# The ASF module contains a set of classes which encapsulate access to a number
+# of data sources such as LDAP, ICLAs, auth lists, etc. This code originally
+# was developed as a part of separate tools and was later refactored out into a
+# common library. Some of the older tools don't fully make use of this
+# refactoring.
+#
+
 module ASF
+  # Last modified time of any file in the entire source tree.
   def self.library_mtime
     parent_dir = File.dirname(File.expand_path(__FILE__))
     sources = Dir.glob("#{parent_dir}/**/*")
@@ -22,6 +31,7 @@ module ASF
     times.max.gmtime
   end
 
+  # Last commit in this clone, and the date and time of that commit.
   def self.library_gitinfo
     return @info if @info
     @info = `git show --format="%h  %ci"  -s HEAD`.strip
diff --git a/lib/whimsy/asf/ldap.rb b/lib/whimsy/asf/ldap.rb
index 40b29a1..a72cb1b 100644
--- a/lib/whimsy/asf/ldap.rb
+++ b/lib/whimsy/asf/ldap.rb
@@ -264,15 +264,14 @@ module ASF
     end
   end
 
-  # determine where ldap.conf resides
-  if Dir.exist? '/etc/openldap'
-    ETCLDAP = '/etc/openldap'
-  else
-    ETCLDAP = '/etc/ldap'
+  # Directory where ldap.conf resides.  Differs based on operating system.
+  ETCLDAP = case
+    when Dir.exist?('/etc/openldap') then '/etc/openldap'
+    when Dir.exist?('/usr/local/etc/openldap') then '/user/local//etc/openldap'
+    else '/etc/ldap'
   end
-  # Note: FreeBSD seems to use
-  # /usr/local/etc/openldap/ldap.conf
 
+  # Returns existing LDAP connection, creating one if necessary.
   def self.ldap
     @ldap || self.init_ldap
   end
@@ -340,18 +339,26 @@ module ASF
     end
   end
 
+  # shortcut for derefernce weakref
   def self.weakref(attr, &block)
     self.dereference_weakref(self, attr, &block)
   end
 
+  # Obtain a list of PMC chairs from LDAP 
+  # <tt>cn=pmc-chairs,ou=groups,ou=services,dc=apache,dc=org</tt>
   def self.pmc_chairs
     weakref(:pmc_chairs) {Service.find('pmc-chairs').members}
   end
 
+  # Obtain a list of committers from LDAP 
+  # <tt>cn=committers,ou=groups,dc=apache,dc=org</tt>
   def self.committers
     weakref(:committers) {Group.find('committers').members}
   end
 
+  # Obtain a list of members from LDAP 
+  # <tt>cn=member,ou=groups,dc=apache,dc=org</tt>
+  # Note: includes some non-ASF member infrastructure contractors
   def self.members
     weakref(:members) {Group.find('member').members}
   end
diff --git a/lib/whimsy/asf/orgchart.rb b/lib/whimsy/asf/orgchart.rb
index ed6b1ad..31987ab 100644
--- a/lib/whimsy/asf/orgchart.rb
+++ b/lib/whimsy/asf/orgchart.rb
@@ -1,6 +1,6 @@
 ##
 # Part of the whimsy/ASF module of classes that provide simple access to ASF data.
-module ASF
+module ASF # :nodoc:
   
   ##
   # Reads and provides access to the officers/personnel-duties/ROLENAME.yaml files.

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <commits@whimsical.apache.org>'].

Mime
View raw message