sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit ac76293ab93e58651d80a86144537c2e31e6f4d4
parent c4aa7e8257dfd522af67bcef86db5dde451510ab
Author: Iain Parris <ip2.vcs@parris.org>
Date:   Wed, 17 Jun 2020 00:01:33 +0100

Ruby 2.7 - fix lib/sup/crypto.rb 'verified_ok?' FrozenError

In Ruby 2.7, core method #to_s now returns a frozen string. See:
.

We therefore need to modify lib/sup/crypto.rb 'verified_ok?' to use
.to_s.dup, because 'verified_ok?' calls 'simplify_sig_line', which in
turn uses 'sub!' - which is invalid on a frozen string (raises
FrozenError).

We now have a passing Travis CI build with all currently supported
versions of Ruby (2.5, 2.6, 2.7) on a modern Linux distribution (Ubuntu
20.04 LTS, 'focal'). Fixes #552.

Diffstat:
M .travis.yml | 1 +
M lib/sup/crypto.rb | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/.travis.yml b/.travis.yml
@@ -5,6 +5,7 @@ dist: focal
 rvm:
   - 2.5
   - 2.6
+  - 2.7
 
 before_install:
   - sudo apt update -qq
diff --git a/lib/sup/crypto.rb b/lib/sup/crypto.rb
@@ -233,7 +233,7 @@ EOS
     end
 
     if valid || !unknown
-      summary_line = simplify_sig_line(verify_result.signatures[0].to_s, all_trusted)
+      summary_line = simplify_sig_line(verify_result.signatures[0].to_s.dup, all_trusted)
     end
 
     if all_output_lines.length == 0