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:
Hiroshi SHIBATA 2024-05-30 10:32:33 +09:00
parent 01aa77faa2
commit f1702261d7
No known key found for this signature in database
GPG Key ID: F9CF13417264FAC2

View File

@ -66,25 +66,25 @@ class String
def color(fore=nil, back=nil, opts={}, bold: false, underscore: false)
seq = ""
if bold || opts[:bold]
seq << "\e[1m"
seq = seq + "\e[1m"
end
if underscore || opts[:underscore]
seq << "\e[2m"
seq = seq + "\e[2m"
end
if fore
c = COLORS[fore]
raise "unknown foreground color #{fore}" unless c
seq << "\e[#{c}m"
seq = seq + "\e[#{c}m"
end
if back
c = COLORS[back]
raise "unknown background color #{back}" unless c
seq << "\e[#{c + 10}m"
seq = seq + "\e[#{c + 10}m"
end
if seq.empty?
self
else
seq << self << "\e[0m"
seq = seq + self + "\e[0m"
end
end
end