lib/nanoc/helpers/capturing.rb in nanoc-4.8.5 vs lib/nanoc/helpers/capturing.rb in nanoc-4.8.6
- old
+ new
@@ -128,11 +128,11 @@
else
raise ArgumentError, 'expected 2 or 3 arguments (the name ' \
"of the capture, optionally params, and the content) but got #{args.size} instead"
end
- _erbout = String.new # rubocop:disable Lint/UnderscorePrefixedVariableName
+ _erbout = +'' # rubocop:disable Lint/UnderscorePrefixedVariableName
SetContent.new(name, params, @item).run { _erbout << content }
else # Get content
if args.size != 2
raise ArgumentError, 'expected 2 arguments (the item ' \
"and the name of the capture) but got #{args.size} instead"
@@ -155,10 +155,10 @@
# Get new piece of erbout
erbout_addition = erbout[erbout_length..-1]
# Remove addition
- erbout[erbout_length..-1] = String.new
+ erbout[erbout_length..-1] = +''
# Depending on how the filter outputs, the result might be a
# single string or an array of strings (slim outputs the latter).
erbout_addition = erbout_addition.join('') if erbout_addition.is_a? Array