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/06 15:41:07 UTC

[whimsy] branch master updated (1cbd9c3 -> da7f445)

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git.


    from 1cbd9c3  Fix up insecure op crash
     new 8553732  Extract sample names as constants
     new da7f445  templates no longer needed

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 lib/spec/lib/svn_spec.rb                       | 67 ++++++++++++++------------
 lib/spec/spec_helper.rb                        |  6 ++-
 lib/test/svn/{templates => minutes}/README.txt |  0
 repository.yml                                 |  9 ++--
 4 files changed, 43 insertions(+), 39 deletions(-)
 rename lib/test/svn/{templates => minutes}/README.txt (100%)


[whimsy] 02/02: templates no longer needed

Posted by se...@apache.org.
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

commit da7f4456add6d0d6fc33d509382d67965277c0b8
Author: Sebb <se...@apache.org>
AuthorDate: Mon Jul 6 16:40:52 2020 +0100

    templates no longer needed
---
 lib/spec/lib/svn_spec.rb                       | 4 +---
 lib/spec/spec_helper.rb                        | 6 +++++-
 lib/test/svn/{templates => minutes}/README.txt | 0
 repository.yml                                 | 9 +++------
 4 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/lib/spec/lib/svn_spec.rb b/lib/spec/lib/svn_spec.rb
index 8439be7..3edd543 100644
--- a/lib/spec/lib/svn_spec.rb
+++ b/lib/spec/lib/svn_spec.rb
@@ -5,8 +5,6 @@ require 'spec_helper'
 require 'whimsy/asf'
 require 'wunderbar'
 
-SAMPLE_SVN_NAME = 'minutes' # name of checkout of public SVN dir
-SAMPLE_SVN_URL_RE = %r{https://.+/minutes}
 SAMPLE_MISSING_NAME = '__templates' # no such entry
 SAMPLE_ALIAS = 'Bills' # depth: 'skip'
 
@@ -120,7 +118,7 @@ describe ASF::SVN do
       res = ASF::SVN.private_public
       expect(res.size()).to equal(2)
       expect(res[0].size).to equal(14) # will need to be adjusted from time to time
-      expect(res[1].size).to equal(9) # ditto.
+      expect(res[1].size).to equal(8) # ditto.
     end
   end
 
diff --git a/lib/spec/spec_helper.rb b/lib/spec/spec_helper.rb
index e9f74bd..e6930b8 100644
--- a/lib/spec/spec_helper.rb
+++ b/lib/spec/spec_helper.rb
@@ -1,13 +1,17 @@
 $LOAD_PATH.unshift '/srv/whimsy/lib'
 
 require 'whimsy/asf'
+
+SAMPLE_SVN_NAME = 'minutes' # name of checkout of public SVN dir
+SAMPLE_SVN_URL_RE = %r{https://.+/minutes}
+
 # Override with test data if there is no checkout available (allows local use)
 if ENV['RAKE_TEST'] == 'TRUE' or not (ASF::SVN.find('apmail_bin') and ASF::SVN.find('board'))
   TEST_DATA = true # Test data is smaller so some tests need adjusting
   puts "Overriding data directories"
   ASF::SVN['apmail_bin'] = File.expand_path('../test/svn/apmail_bin', __dir__)
   ASF::SVN['board'] = File.expand_path('../test/svn/board', __dir__)
-  ASF::SVN['templates'] = File.expand_path('../test/svn/templates', __dir__)
+  ASF::SVN[SAMPLE_SVN_NAME] = File.expand_path('../test/svn/minutes', __dir__)
   ASF::Config[:subscriptions] = File.expand_path('../test/subscriptions', __dir__)
 else
   TEST_DATA = false
diff --git a/lib/test/svn/templates/README.txt b/lib/test/svn/minutes/README.txt
similarity index 100%
rename from lib/test/svn/templates/README.txt
rename to lib/test/svn/minutes/README.txt
diff --git a/repository.yml b/repository.yml
index ae224d2..47c5b3a 100644
--- a/repository.yml
+++ b/repository.yml
@@ -65,10 +65,10 @@
     depth: delete
     list: true
 
-  comdev-foundation:
+  comdev-foundation: # only want projects.json?
     url: asf/comdev/projects.apache.org/trunk/site/json/foundation
 
-  comdevtalks:
+  comdevtalks: # only used in example.cgi?
     url: asf/comdev/site/trunk/content/speakers/talks
     depth: files
 
@@ -142,7 +142,7 @@
     url: private/foundation/officers
     depth: files
 
-  officers_historic:
+  officers_historic: # only need committers.json ?
     url: private/foundation/officers/historic
 
   officers_surveys:
@@ -175,6 +175,3 @@
 
   steve:
     url: asf/steve/trunk
-
-  templates:
-    url: asf/infrastructure/site/trunk/templates


[whimsy] 01/02: Extract sample names as constants

Posted by se...@apache.org.
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

commit 8553732bcf0efbe3eac348d9e0cf512b960e7110
Author: Sebb <se...@apache.org>
AuthorDate: Mon Jul 6 16:27:37 2020 +0100

    Extract sample names as constants
    
    Also change templates as it was only used here
---
 lib/spec/lib/svn_spec.rb | 67 ++++++++++++++++++++++++++----------------------
 1 file changed, 36 insertions(+), 31 deletions(-)

diff --git a/lib/spec/lib/svn_spec.rb b/lib/spec/lib/svn_spec.rb
index 6732f2d..8439be7 100644
--- a/lib/spec/lib/svn_spec.rb
+++ b/lib/spec/lib/svn_spec.rb
@@ -5,37 +5,42 @@ require 'spec_helper'
 require 'whimsy/asf'
 require 'wunderbar'
 
+SAMPLE_SVN_NAME = 'minutes' # name of checkout of public SVN dir
+SAMPLE_SVN_URL_RE = %r{https://.+/minutes}
+SAMPLE_MISSING_NAME = '__templates' # no such entry
+SAMPLE_ALIAS = 'Bills' # depth: 'skip'
+
 describe ASF::SVN do
   
   # repo_entry should only include repos that have local workspaces
   
   describe "ASF::SVN.repo_entry" do
-    it "should return string for 'templates'" do
-      res = ASF::SVN.repo_entry('templates')
+    it "should return Hash for #{SAMPLE_SVN_NAME}" do
+      res = ASF::SVN.repo_entry(SAMPLE_SVN_NAME)
       expect(res.class).to equal(Hash)
     end
 
-    it "should return nil for 'Bills'" do
-      res = ASF::SVN.repo_entry('Bills')
+    it "should return nil for #{SAMPLE_ALIAS}" do
+      res = ASF::SVN.repo_entry(SAMPLE_ALIAS)
       expect(res.class).to equal(NilClass)
     end
 
-    it "should return nil for '__templates'" do
-      res = ASF::SVN.repo_entry('__templates')
+    it "should return nil for #{SAMPLE_MISSING_NAME}" do
+      res = ASF::SVN.repo_entry(SAMPLE_MISSING_NAME)
       expect(res.class).to equal(NilClass)
     end
 
   end
 
   describe "ASF::SVN.repo_entry!" do
-    it "should return string for 'templates'" do
-      res = ASF::SVN.repo_entry!('templates')
+    it "should return string for #{SAMPLE_SVN_NAME}" do
+      res = ASF::SVN.repo_entry!(SAMPLE_SVN_NAME)
       expect(res.class).to equal(Hash)
     end
 
-    it "should fail for '__templates'" do
+    it "should fail for #{SAMPLE_MISSING_NAME}" do
       expect{
-        ASF::SVN.repo_entry!('__templates')
+        ASF::SVN.repo_entry!(SAMPLE_MISSING_NAME)
       }.to raise_error(Exception)
     end
 
@@ -44,35 +49,35 @@ describe ASF::SVN do
   # svnurl should include aliases
 
   describe "ASF::SVN.svnurl" do
-    it "should return URL for 'templates'" do
-      res = ASF::SVN.svnurl('templates')
+    it "should return URL for #{SAMPLE_SVN_NAME}" do
+      res = ASF::SVN.svnurl(SAMPLE_SVN_NAME)
       expect(res.class).to equal(String)
-      expect(res).to match(%r{https://.+/templates}) 
+      expect(res).to match(SAMPLE_SVN_URL_RE) 
     end
   
-    it "should return URL for 'Bills'" do
-      res = ASF::SVN.svnurl('Bills')
+    it "should return URL for #{SAMPLE_ALIAS}" do
+      res = ASF::SVN.svnurl(SAMPLE_ALIAS)
       expect(res.class).to equal(String)
       expect(res).to match(%r{https://.+/Bills}) 
     end
   
-    it "should return nil for '__templates'" do
-      res = ASF::SVN.svnurl('__templates')
+    it "should return nil for #{SAMPLE_MISSING_NAME}" do
+      res = ASF::SVN.svnurl(SAMPLE_MISSING_NAME)
       expect(res.class).to equal(NilClass)
     end
   
   end
 
   describe "ASF::SVN.svnurl!" do
-    it "should return URL for 'templates'" do
-      res = ASF::SVN.svnurl!('templates')
+    it "should return URL for #{SAMPLE_SVN_NAME}" do
+      res = ASF::SVN.svnurl!(SAMPLE_SVN_NAME)
       expect(res.class).to equal(String)
-      expect(res).to match(%r{https://.+/templates}) 
+      expect(res).to match(SAMPLE_SVN_URL_RE) 
     end
   
-    it "should fail for '__templates'" do
+    it "should fail for #{SAMPLE_MISSING_NAME}" do
       expect {
-        ASF::SVN.svnurl!('__templates')
+        ASF::SVN.svnurl!(SAMPLE_MISSING_NAME)
       }.to raise_error(Exception)
     end
   
@@ -81,11 +86,11 @@ describe ASF::SVN do
   # repo_entries should exclude aliases
 
   describe "ASF::SVN.repo_entries" do
-    it "should return hash with templates but not Bills" do
+    it "should return hash with #{SAMPLE_SVN_NAME} but not #{SAMPLE_ALIAS}" do
       res = ASF::SVN.repo_entries
       expect(res.class).to equal(Hash)
-      expect(res['templates'].class).to equal(Hash)
-      expect(res['Bills']).to equal(nil)
+      expect(res[SAMPLE_SVN_NAME].class).to equal(Hash)
+      expect(res[SAMPLE_ALIAS]).to equal(nil)
     end
     
   end
@@ -93,18 +98,18 @@ describe ASF::SVN do
   # find returns local workspace so excludes aliases
 
   describe "ASF::SVN.find" do
-    it "should return string for 'templates'" do
-      res = ASF::SVN.find('templates')
+    it "should return string for #{SAMPLE_SVN_NAME}" do
+      res = ASF::SVN.find(SAMPLE_SVN_NAME)
       expect(res.class).to equal(String)
     end
   
-    it "should return nil for 'Bills'" do
-      res = ASF::SVN.find('Bills')
+    it "should return nil for #{SAMPLE_ALIAS}" do
+      res = ASF::SVN.find(SAMPLE_ALIAS)
       expect(res.class).to equal(NilClass)
     end
   
-    it "should return nil for '__templates'" do
-      res = ASF::SVN.find('__templates')
+    it "should return nil for #{SAMPLE_MISSING_NAME}" do
+      res = ASF::SVN.find(SAMPLE_MISSING_NAME)
       expect(res.class).to equal(NilClass)
     end