Suppress warnings about frozen string literal feature
``` tool/redmine-backporter.rb:69: warning: literal string will be frozen in the future ```
This commit is contained in:
parent
01aa77faa2
commit
f1702261d7
@ -66,25 +66,25 @@ class String
|
|||||||
def color(fore=nil, back=nil, opts={}, bold: false, underscore: false)
|
def color(fore=nil, back=nil, opts={}, bold: false, underscore: false)
|
||||||
seq = ""
|
seq = ""
|
||||||
if bold || opts[:bold]
|
if bold || opts[:bold]
|
||||||
seq << "\e[1m"
|
seq = seq + "\e[1m"
|
||||||
end
|
end
|
||||||
if underscore || opts[:underscore]
|
if underscore || opts[:underscore]
|
||||||
seq << "\e[2m"
|
seq = seq + "\e[2m"
|
||||||
end
|
end
|
||||||
if fore
|
if fore
|
||||||
c = COLORS[fore]
|
c = COLORS[fore]
|
||||||
raise "unknown foreground color #{fore}" unless c
|
raise "unknown foreground color #{fore}" unless c
|
||||||
seq << "\e[#{c}m"
|
seq = seq + "\e[#{c}m"
|
||||||
end
|
end
|
||||||
if back
|
if back
|
||||||
c = COLORS[back]
|
c = COLORS[back]
|
||||||
raise "unknown background color #{back}" unless c
|
raise "unknown background color #{back}" unless c
|
||||||
seq << "\e[#{c + 10}m"
|
seq = seq + "\e[#{c + 10}m"
|
||||||
end
|
end
|
||||||
if seq.empty?
|
if seq.empty?
|
||||||
self
|
self
|
||||||
else
|
else
|
||||||
seq << self << "\e[0m"
|
seq = seq + self + "\e[0m"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user