whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject [whimsy] branch master updated: monkey patch mail gem to work around a regression introduced in 2.7.0
Date Fri, 03 Nov 2017 15:46:35 GMT
This is an automated email from the ASF dual-hosted git repository.

rubys 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 465cc35  monkey patch mail gem to work around a regression introduced in 2.7.0
465cc35 is described below

commit 465cc35232ed1c9a9d8f98d1150d25081b844884
Author: Sam Ruby <rubys@intertwingly.net>
AuthorDate: Fri Nov 3 11:46:27 2017 -0400

    monkey patch mail gem to work around a regression introduced in 2.7.0
---
 www/secretary/workbench/server.rb | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/www/secretary/workbench/server.rb b/www/secretary/workbench/server.rb
index 9223381..51ed816 100644
--- a/www/secretary/workbench/server.rb
+++ b/www/secretary/workbench/server.rb
@@ -18,6 +18,28 @@ require_relative 'models/safetemp'
 require_relative 'models/events'
 require_relative 'tasks'
 
+
+# monkey patch mail gem to work around a regression introduced in 2.7.0:
+# https://github.com/mikel/mail/pull/1168
+module Mail
+  class Message
+    def raw_source=(value)
+      @raw_source = ::Mail::Utilities.to_crlf(value)
+    end
+  end
+
+  module Utilities
+    def self.safe_for_line_ending_conversion?(string)
+      if RUBY_VERSION >= '1.9'
+        string.ascii_only? or 
+          (string.encoding != Encoding::BINARY and string.valid_encoding?)
+      else
+        string.ascii_only?
+      end
+    end
+  end
+end
+
 require 'whimsy/asf'
 ASF::Mail.configure
 

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <commits@whimsical.apache.org>'].

Mime
View raw message