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 079b1e1a Improve parsing
079b1e1a is described below
commit 079b1e1aeef6e9995069afaab947824892e5f79c
Author: Sebb <[email protected]>
AuthorDate: Wed Mar 15 16:56:40 2023 +0000
Improve parsing
---
tools/site_member_check.rb | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
diff --git a/tools/site_member_check.rb b/tools/site_member_check.rb
index b3a7c958..30e81fd7 100755
--- a/tools/site_member_check.rb
+++ b/tools/site_member_check.rb
@@ -27,8 +27,15 @@ current = ASF::Member.current
MEMBERS = 'apache/www-site/main/content/foundation/members.md'
-code, contents = ASF::Git.github(MEMBERS)
-raise "Could not read #{MEMBERS}, error: #{code}" unless code == '200'
+file = ARGV.shift # Override for local testing
+if file
+ puts "Reading #{file}"
+ contents = File.read(file)
+else
+ puts "Fetching members.md"
+ code, contents = ASF::Git.github(MEMBERS)
+ raise "Could not read #{MEMBERS}, error: #{code}" unless code == '200'
+end
# # Members of The Apache Software Foundation #
#
@@ -44,13 +51,20 @@ puts "===================="
s = StringScanner.new(contents)
s.skip_until(/\| Id \| Name \| Projects \|\n/)
s.skip_until(/\n/)
+prev = nil # for context on error
loop do
s.scan(/\| (\S+) \|.*?$/)
- id = s[1] or break
- puts "#{id} #{status[id] || 'unknown status'}" unless current.include? id
+ id = s[1]
+ unless current.include? id
+ puts "#{id}: #{status[id] || 'unknown status'}"
+ puts "Previous id: #{prev}" unless id
+ end
+ prev = id
s.skip_until(/\n/)
+ break if s.match? %r{^\s*$|^##} # blank line or next section
end
+
# ## Emeritus Members of The Apache Software Foundation
#
# | Id | Name |