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 11:27:17 UTC
[whimsy] branch master updated: Library access to CCLAs
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 e38bbe7 Library access to CCLAs
e38bbe7 is described below
commit e38bbe76f310ec40f9a5e9b312238902f102279e
Author: Sebb <se...@apache.org>
AuthorDate: Fri Nov 29 11:27:02 2019 +0000
Library access to CCLAs
---
lib/whimsy/asf.rb | 1 +
lib/whimsy/asf/ccla.rb | 23 +++++++++++++++++++++++
2 files changed, 24 insertions(+)
diff --git a/lib/whimsy/asf.rb b/lib/whimsy/asf.rb
index d1ba48b..50a89dc 100644
--- a/lib/whimsy/asf.rb
+++ b/lib/whimsy/asf.rb
@@ -7,6 +7,7 @@ require_relative 'asf/git'
require_relative 'asf/watch'
require_relative 'asf/nominees'
require_relative 'asf/icla'
+require_relative 'asf/ccla'
require_relative 'asf/auth'
require_relative 'asf/member'
require_relative 'asf/podling'
diff --git a/lib/whimsy/asf/ccla.rb b/lib/whimsy/asf/ccla.rb
new file mode 100644
index 0000000..2a07414
--- /dev/null
+++ b/lib/whimsy/asf/ccla.rb
@@ -0,0 +1,23 @@
+require 'json'
+
+module ASF
+
+ # Common class for access to documents/cclas/ directory
+ class CCLAFiles
+ @@CCLAFILES = nil # cache the find if actually needed
+
+ # listing of top-level icla file/directory names
+ # Directories are listed without trailing "/"
+ def self.listnames
+ @@CCLAFILES = ASF::SVN['cclas'] unless @@CCLAFILES
+ Dir[File.join(@@CCLAFILES, '*')]
+ end
+
+ # Does an entry exist?
+ def self.exist?(name)
+ @@CCLAFILES = ASF::SVN['cclas'] unless @@CCLAFILES
+ Dir[File.join(@@CCLAFILES, name)].any?
+ end
+ end
+
+end