whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [whimsy] branch master updated: givenName is optional
Date Mon, 21 Jun 2021 21:42:48 GMT
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 2ffeac4  givenName is optional
2ffeac4 is described below

commit 2ffeac4630b7ae107f9a0200430dabc9a56b94c0
Author: Sebb <sebb@apache.org>
AuthorDate: Mon Jun 21 22:42:39 2021 +0100

    givenName is optional
---
 lib/whimsy/asf/person.rb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/whimsy/asf/person.rb b/lib/whimsy/asf/person.rb
index e98ee25..4980b68 100644
--- a/lib/whimsy/asf/person.rb
+++ b/lib/whimsy/asf/person.rb
@@ -149,7 +149,8 @@ module ASF
         result['title'] ||= title
       end
       result['generationQualifier'] = words.pop if words.last =~ SUFFIXES
-      result['givenName'] = words.shift # TODO does gn allow multiple words?
+      result['givenName'] = words.shift if words.size > 1 # don't use remaining word as
it must be sn
+      # TODO givenName can have multiple entries
       # extract surnames like van Gogh etc
       if words.size >= 3 and DOUBLE_PFX.include? words[-3..-2].join(' ')
         result['sn'] = words[-3..-1].join(' ')

Mime
View raw message