mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
colorize.rb: read test/colors
file afer $TEST_COLORS
[ci skip]
This commit is contained in:
parent
ce4b5d90b2
commit
58fd27d3d8
1 changed files with 6 additions and 0 deletions
|
@ -7,6 +7,12 @@ class Colorize
|
|||
if (/\A\e\[.*m\z/ =~ IO.popen("tput smso", "r", err: IO::NULL, &:read) rescue nil)
|
||||
@beg = "\e["
|
||||
@colors = (colors = ENV['TEST_COLORS']) ? Hash[colors.scan(/(\w+)=([^:\n]*)/)] : {}
|
||||
begin
|
||||
File.read(File.join(__dir__, "../test/colors")).scan(/(\w+)=([^:\n]*)/) do |n, c|
|
||||
colors[n] ||= c
|
||||
end
|
||||
rescue
|
||||
end
|
||||
@reset = "#{@beg}m"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue