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 2019/11/29 09:15:26 UTC

[whimsy] branch master updated: Move listing to library routine

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 777c0cd  Move listing to library routine
777c0cd is described below

commit 777c0cd465b78dc6138a99720a0c24214e01f777
Author: Sebb <se...@apache.org>
AuthorDate: Fri Nov 29 09:15:17 2019 +0000

    Move listing to library routine
    
    So can change how the listing is generated
---
 lib/whimsy/asf/icla.rb      | 6 ++++++
 www/secretary/icla-lint.cgi | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/lib/whimsy/asf/icla.rb b/lib/whimsy/asf/icla.rb
index 9cfabae..b94e059 100644
--- a/lib/whimsy/asf/icla.rb
+++ b/lib/whimsy/asf/icla.rb
@@ -273,6 +273,12 @@ module ASF
       file = Dir[File.join(@@ICLAFILES, claRef), File.join(@@ICLAFILES, "#{claRef}.*")].first
       File.basename(file) if file
     end
+
+    # listing of top-level icla file/directory names
+    # Directories are listed without trailing "/"
+    def self.listnames
+      Dir[File.join(ASF::SVN['iclas'], '*')]
+    end
   end
 
 end
diff --git a/www/secretary/icla-lint.cgi b/www/secretary/icla-lint.cgi
index 126ca2e..986b701 100755
--- a/www/secretary/icla-lint.cgi
+++ b/www/secretary/icla-lint.cgi
@@ -72,7 +72,7 @@ _html do
 
   iclas = Hash.new{|h,k| h[k]=[]}
   dupes=0
-  Dir[File.join(ASF::SVN['iclas'], '*')].each do |file|
+  ASF::ICLAFiles.listnames.each do |file|
     name = File.basename(file)
     stem = name.sub(/\.\w+$/, '')
     dupes += 1 if iclas.has_key? stem