ruby-changes:55992
From: Nobuyoshi <ko1@a...>
Date: Tue, 4 Jun 2019 17:10:29 +0900 (JST)
Subject: [ruby-changes:55992] Nobuyoshi Nakada: 58fd27d3d8 (trunk): colorize.rb: read `test/colors` file afer `$TEST_COLORS`
https://git.ruby-lang.org/ruby.git/commit/?id=58fd27d3d8 From 58fd27d3d89451fbbe840348cd66f2205e34e72b Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Tue, 4 Jun 2019 17:06:12 +0900 Subject: colorize.rb: read `test/colors` file afer `$TEST_COLORS` [ci skip] diff --git a/tool/colorize.rb b/tool/colorize.rb index 1cbbeef..73dd9e5 100644 --- a/tool/colorize.rb +++ b/tool/colorize.rb @@ -7,6 +7,12 @@ class Colorize https://github.com/ruby/ruby/blob/trunk/tool/colorize.rb#L7 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 -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/