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/09/26 20:31:03 UTC
[whimsy] branch master updated: Delay fetching the config so
spec_helper can run
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 bd001c6 Delay fetching the config so spec_helper can run
bd001c6 is described below
commit bd001c65369ceca981f471fb3c5f7495ecdc67b9
Author: Sebb <se...@apache.org>
AuthorDate: Thu Sep 26 21:30:58 2019 +0100
Delay fetching the config so spec_helper can run
---
lib/whimsy/asf/mail.rb | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/lib/whimsy/asf/mail.rb b/lib/whimsy/asf/mail.rb
index ea6aa90..9c530a3 100644
--- a/lib/whimsy/asf/mail.rb
+++ b/lib/whimsy/asf/mail.rb
@@ -212,15 +212,13 @@ module ASF
private
- # flags for each mailing list
- LIST_BASE = ASF::Config[:subscriptions] # allow overrides for testing etc
- LIST_FLAGS = File.join(LIST_BASE, 'list-flags')
-
# Parse the flags file
def self._load_flags
- if not @flags or File.mtime(LIST_FLAGS) != @flags_mtime
+ # flags for each mailing list
+ @list_flags ||= File.join(ASF::Config[:subscriptions], 'list-flags')
+ if not @flags or File.mtime(@list_flags) != @flags_mtime
lists = []
- File.open(LIST_FLAGS).each do |line|
+ File.open(@list_flags).each do |line|
if line.match(/^F:-([a-zA-Z]{26}) (\S+) (\S+)/)
flags,dom,list=$1,$2,$3
next if list =~ /^infra-[a-z]$/ or (dom == 'incubator' and list == 'infra-dev')
@@ -230,7 +228,7 @@ module ASF
end
end
@flags = lists
- @flags_mtime = File.mtime(LIST_FLAGS)
+ @flags_mtime = File.mtime(@list_flags)
end
end