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: Add listnames as per other docs
Date Fri, 29 Nov 2019 22:42:46 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 ae33a95  Add listnames as per other docs
ae33a95 is described below

commit ae33a95abb17411a107ebca83e3d5de3cc0b6870
Author: Sebb <sebb@apache.org>
AuthorDate: Fri Nov 29 22:42:35 2019 +0000

    Add listnames as per other docs
---
 lib/whimsy/asf/documents.rb | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/lib/whimsy/asf/documents.rb b/lib/whimsy/asf/documents.rb
index 0d477b5..c18d10e 100644
--- a/lib/whimsy/asf/documents.rb
+++ b/lib/whimsy/asf/documents.rb
@@ -40,16 +40,20 @@ module ASF
 
   # Common class for access to documents/iclas/ directory
   class ICLAFiles
-    @@tag = nil
+    @@tag = nil # probably worth caching iclas
     # search icla files to find match with claRef
     # Returns the basename or nil if no match
     def self.match_claRef(claRef)
+      # Match either full name (e.g. directory) or stem (e.g. name.pdf)
+      file = listnames.select{|l| l == claRef || l.start_with?("#{claRef}.") }.first
+    end
+
+    def self.listnames
       @@tag, list = ASF::SVN.getlisting('iclas', @@tag)
       if list
-        @@list = list.map
+        @@list = list
       end
-      # Match either full name (e.g. directory) or stem (e.g. name.pdf)
-      file = @@list.select{|l| l == claRef || l.start_with?("#{claRef}.") }.first
+      @@list      
     end
   end
 


Mime
View raw message