diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-06-04 17:06:12 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-06-04 17:07:33 +0900 |
commit | 58fd27d3d89451fbbe840348cd66f2205e34e72b (patch) | |
tree | 7e502cc1496ee292f656a36bc321f6dc4cf07191 /tool | |
parent | ce4b5d90b2127af185f91037de1185ad7520ace3 (diff) |
colorize.rb: read `test/colors` file afer `$TEST_COLORS`
[ci skip]
Diffstat (limited to 'tool')
-rw-r--r-- | tool/colorize.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tool/colorize.rb b/tool/colorize.rb index 1cbbeef543..73dd9e52fd 100644 --- a/tool/colorize.rb +++ b/tool/colorize.rb @@ -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 |