You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by se...@apache.org on 2021/07/26 22:45:05 UTC
[whimsy] branch master updated: Simplify; add doc note
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 cf561d9 Simplify; add doc note
cf561d9 is described below
commit cf561d92e7b3943b17e9d78bd4c5f5482628360d
Author: Sebb <se...@apache.org>
AuthorDate: Mon Jul 26 23:44:57 2021 +0100
Simplify; add doc note
---
lib/whimsy/asf/person.rb | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/lib/whimsy/asf/person.rb b/lib/whimsy/asf/person.rb
index 49508cd..871b735 100644
--- a/lib/whimsy/asf/person.rb
+++ b/lib/whimsy/asf/person.rb
@@ -167,18 +167,21 @@ module ASF
# extract sn and givenName from cn (needed for LDAP entries)
# returns sn, [givenName,...]
+ # Note that givenName is returned as an array (may be empty).
+ # This is because givenName is an optional attribute which may appear multiple times.
+ # It remains to be seen whether we want to create multiple attributes,
+ # or whether it is more appropriate to add at most one attribute
+ # containing all the givenName values. [The array can be joined to produce a single value].
# DRAFT version: not for general use yet
# Does not handle multi-word family names or honorifics etc
def self.ldap_parse_cn_DRAFT(cn, familyFirst)
words = cn.split(' ')
if familyFirst
sn = words.shift
- givenName = words
else
sn = words.pop
- givenName = words
end
- return sn, givenName
+ return sn, words
end
# Name equivalences