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 6f52f6c  Simplify
6f52f6c is described below

commit 6f52f6ce451cfbf032c833d5adb1938a6f968a6b
Author: Sebb <[email protected]>
AuthorDate: Sun Feb 28 15:18:31 2021 +0000

    Simplify
---
 lib/whimsy/asf/member-files.rb | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/lib/whimsy/asf/member-files.rb b/lib/whimsy/asf/member-files.rb
index 8e30f67..dce855f 100644
--- a/lib/whimsy/asf/member-files.rb
+++ b/lib/whimsy/asf/member-files.rb
@@ -32,7 +32,7 @@ module ASF
       # automatically transcode strings, so we do it here.
       # This is necessary to avoid issues with matching Regexes.
       File.open(nomfile, mode='rb:UTF-8')
-        .map{|l| l.encode('utf-8', invalid: :replace)}
+        .map(&:scrub)
         .slice_before(/^\s*---+--\s*/)
         .drop(2) # instructions and sample block
         .each do |block|
@@ -90,7 +90,17 @@ module ASF
 end
 
 if __FILE__ == $0
-  ASF::MemberFiles.member_nominees.each {|k,v| p [k, v['Public Name'], 
v['Public Name']&.encoding]}
+  ASF::MemberFiles.member_nominees.each do |k,v| 
+    p [k, 
+       v['Public Name'], 
+       v['Public Name']&.encoding,
+       v['Public Name']&.valid_encoding?]
+  end
   puts "--------------"
-  ASF::MemberFiles.board_nominees.each {|k,v| p [k, v['Public Name'], 
v['Public Name']&.encoding]}
+  ASF::MemberFiles.board_nominees.each do |k,v| 
+    p [k, 
+      v['Public Name'], 
+      v['Public Name']&.encoding,
+      v['Public Name']&.valid_encoding?]
+ end
 end
\ No newline at end of file

Reply via email to