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 2020/07/11 17:29:17 UTC
[whimsy] branch master updated: Get full path to emeritus file
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 8e36caf Get full path to emeritus file
8e36caf is described below
commit 8e36caf43ec85263eb5dfeaed2a0be8bfcecb48d
Author: Sebb <se...@apache.org>
AuthorDate: Sat Jul 11 18:29:06 2020 +0100
Get full path to emeritus file
---
lib/whimsy/asf/documents.rb | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/lib/whimsy/asf/documents.rb b/lib/whimsy/asf/documents.rb
index 34fd239..d447347 100644
--- a/lib/whimsy/asf/documents.rb
+++ b/lib/whimsy/asf/documents.rb
@@ -109,6 +109,9 @@ module ASF
list
end
+ # Find the file name that matches a person
+ # return nil if not exactly one match
+ # TODO: should it raise an error on multiple matches?
def self.find(person)
# TODO use common stem name method
name = (person.attrs['cn'].first rescue person.member_name).force_encoding('utf-8').
@@ -125,6 +128,16 @@ module ASF
nil
end
end
+
+ # Find the file for a person and return as a path name
+ # nil if not found
+ def self.findpath(person)
+ ret = self.find(person)
+ if ret
+ ret = ASF::SVN.svnpath!(@base, ret)
+ end
+ end
+
# Extract the file name from an svn url
# param rooturl the svn url of the directory
# param fileurl the svn url of the complete file