From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS43350 77.247.176.0/21 X-Spam-Status: No, score=-2.6 required=3.0 tests=AWL,BAYES_05,RCVD_IN_XBL, SPF_FAIL,SPF_HELO_FAIL,TO_EQ_FM_DOM_SPF_FAIL shortcircuit=no autolearn=no autolearn_force=no version=3.4.2 Received: from 80x24.org (politkovskaja.torservers.net [77.247.181.165]) by dcvr.yhbt.net (Postfix) with ESMTP id 1AFB51F405 for ; Sat, 29 Dec 2018 06:15:31 +0000 (UTC) From: Eric Wong To: Subject: [PATCH] oldweb: work around annoying ERB deprecation in Ruby 2.6 Date: Sat, 29 Dec 2018 06:15:28 +0000 Message-Id: <20181229061528.2858-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: *Sigh* https://bugs.ruby-lang.org/issues/15478 --- lib/oldweb.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/oldweb.rb b/lib/oldweb.rb index 910afaf..4d948b9 100644 --- a/lib/oldweb.rb +++ b/lib/oldweb.rb @@ -269,7 +269,11 @@ class Oldweb erbout = "_erbout_#{file_var}" end - template = klass.new(template, nil, '<>', erbout) + if ERB.version =~ /(\d+\.\d+)/ && $1.to_r >= 2.2 + template = klass.new(template, trim_mode: '<>', eoutvar: erbout) + else + template = klass.new(template, nil, '<>', erbout) + end @template_cache[file] = template end -- EW