From 6a3bde35403fdfc656ed8fffbcb5a10e954309cd Mon Sep 17 00:00:00 2001 From: Pat Allan Date: Wed, 28 Jun 2017 20:38:19 +1000 Subject: [PATCH] Frozen-string-literal fixes in eval'd code. The pragma comment doesn't pick up these uses because the code is eval'd on the fly. --- cucumber.yml | 4 ++-- lib/cucumber/term/ansicolor.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cucumber.yml b/cucumber.yml index 2a7ca8118e..cacb347b56 100644 --- a/cucumber.yml +++ b/cucumber.yml @@ -1,9 +1,9 @@ <% cucumber_pro_opts = ENV['ENABLE_CUCUMBER_PRO'] ? "--format Cucumber::Pro --out /dev/null" : "" -std_opts = "--format progress features -r features --strict #{cucumber_pro_opts}" +std_opts = "--format progress features -r features --strict #{cucumber_pro_opts}".dup std_opts << " --tags ~@wip-jruby" if defined?(JRUBY_VERSION) -wip_opts = "--color -r features" +wip_opts = "--color -r features".dup wip_opts << " --tags @wip" if !defined?(JRUBY_VERSION) wip_opts << " --tags @wip,@wip-jruby" if defined?(JRUBY_VERSION) %> diff --git a/lib/cucumber/term/ansicolor.rb b/lib/cucumber/term/ansicolor.rb index 61cf49a803..c4b1c73ce6 100644 --- a/lib/cucumber/term/ansicolor.rb +++ b/lib/cucumber/term/ansicolor.rb @@ -56,7 +56,7 @@ def self.coloring=(val) ATTRIBUTES.each do |c, v| eval %Q{ def #{c}(string = nil) - result = '' + result = String.new result << "\e[#{v}m" if Cucumber::Term::ANSIColor.coloring? if block_given? result << yield