From 081110367e6c7319ceac5d67b92dcc26d8161b95 Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Thu, 28 Jan 2016 13:32:35 -0800 Subject: [PATCH] Make ERB work with --enable-frozen-string-literal --- lib/erb.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/erb.rb b/lib/erb.rb index 5223a28..2e9fad9 100644 --- a/lib/erb.rb +++ b/lib/erb.rb @@ -280,7 +280,7 @@ class ERB # ERB#src: # # compiler = ERB::Compiler.new('<>') - # compiler.pre_cmd = ["_erbout=''"] + # compiler.pre_cmd = ["_erbout=String.new"] # compiler.put_cmd = "_erbout.concat" # compiler.insert_cmd = "_erbout.concat" # compiler.post_cmd = ["_erbout"] @@ -291,7 +291,7 @@ class ERB # Generates: # # #coding:UTF-8 - # _erbout=''; _erbout.concat "Got "; _erbout.concat(( obj ).to_s); _erbout.concat "!\n"; _erbout + # _erbout=String.new; _erbout.concat "Got "; _erbout.concat(( obj ).to_s); _erbout.concat "!\n"; _erbout # # By default the output is sent to the print method. For example: # @@ -860,7 +860,7 @@ def location=((filename, lineno)) def set_eoutvar(compiler, eoutvar = '_erbout') compiler.put_cmd = "#{eoutvar}.concat" compiler.insert_cmd = "#{eoutvar}.concat" - compiler.pre_cmd = ["#{eoutvar} = ''"] + compiler.pre_cmd = ["#{eoutvar} = String.new"] compiler.post_cmd = ["#{eoutvar}.force_encoding(__ENCODING__)"] end -- 2.6.4