Skip to content

Commit 4ccac88

Browse files
committed
Explicitly unfreeze interpolated strings
This fixes a FrozenError on Ruby 2.6/2.7. On Ruby 3.0+ interpolated strings are always unfrozen
1 parent 7efa4d4 commit 4ccac88

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

lib/rexml/element.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ def initialize( arg = UNDEFINED, parent=nil, context=nil )
356356
# e.inspect # => "<foo bar='0' baz='1'> ... </>"
357357
#
358358
def inspect
359-
rv = "<#@expanded_name"
359+
rv = +"<#@expanded_name"
360360

361361
@attributes.each_attribute do |attr|
362362
rv << " "

lib/rexml/xmldecl.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def content(enc)
117117
quote = "'"
118118
end
119119

120-
rv = "version=#{quote}#{@version}#{quote}"
120+
rv = +"version=#{quote}#{@version}#{quote}"
121121
if @writeencoding or enc !~ /\Autf-8\z/i
122122
rv << " encoding=#{quote}#{enc}#{quote}"
123123
end

0 commit comments

Comments
 (0)