summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKornelius Kalnbach <murphy@rubychan.de>2017-07-07 08:42:36 +0200
committerGitHub <noreply@github.com>2017-07-07 08:42:36 +0200
commit66c5d02defe0f215754c1252d5ab61434c313b32 (patch)
tree16fbf06956bc9e4967460bffe945bb85c2d5e9d9
parentef5e2611d6a937fab885eb18a0c6ac5906e65ee8 (diff)
parent761234f380b3e42c283e82d784826bae280f9075 (diff)
downloadcoderay-66c5d02defe0f215754c1252d5ab61434c313b32.tar.gz
Merge pull request #211 from pat/frozen-string-literals
Get tests running with frozen string literals.
-rw-r--r--lib/coderay/encoders/encoder.rb2
-rw-r--r--lib/coderay/encoders/html.rb4
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/coderay/encoders/encoder.rb b/lib/coderay/encoders/encoder.rb
index fa5695d..2baeedb 100644
--- a/lib/coderay/encoders/encoder.rb
+++ b/lib/coderay/encoders/encoder.rb
@@ -146,7 +146,7 @@ module CodeRay
end
def get_output options
- options[:out] || ''
+ options[:out] || ''.dup
end
# Append data.to_s to the output. Returns the argument.
diff --git a/lib/coderay/encoders/html.rb b/lib/coderay/encoders/html.rb
index 942b9c8..1b33e92 100644
--- a/lib/coderay/encoders/html.rb
+++ b/lib/coderay/encoders/html.rb
@@ -176,7 +176,7 @@ module Encoders
if options[:wrap] || options[:line_numbers]
@real_out = @out
- @out = ''
+ @out = ''.dup
end
@break_lines = (options[:break_lines] == true)
@@ -314,7 +314,7 @@ module Encoders
end
def break_lines text, style
- reopen = ''
+ reopen = ''.dup
@opened.each_with_index do |kind, index|
reopen << (@span_for_kinds[index > 0 ? [kind, *@opened[0...index]] : kind] || '<span>')
end