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 d9259fbe Detect bad header
d9259fbe is described below
commit d9259fbec6d86a48fa37083800a5f64c55291153
Author: Sebb <[email protected]>
AuthorDate: Tue Feb 20 19:25:12 2024 +0000
Detect bad header
---
lib/whimsy/asf/member-files.rb | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/whimsy/asf/member-files.rb b/lib/whimsy/asf/member-files.rb
index 2a671a39..3096786b 100644
--- a/lib/whimsy/asf/member-files.rb
+++ b/lib/whimsy/asf/member-files.rb
@@ -48,6 +48,7 @@ module ASF
# Find most recent file:
nomfile = latest_meeting(name)
+ lastheader = nil # what was the last valid header
# It does not appear to be possible to have file open or read
# automatically transcode strings, so we do it here.
# This is necessary to avoid issues with matching Regexes.
@@ -64,6 +65,8 @@ module ASF
.each_with_index do |para, idx|
if idx == 0 # id and name (or just name for board)
header = para.first.strip
+ raise ArgumentError.new "Unexpected start to entry after
#{lastheader}: #{para}" unless header.size > 3
+ lastheader = header
else
key, value = para.shift.strip.split(':', 2)
unless VALID_KEYS.include? key