ruby-changes:55994
From: Nobuyoshi <ko1@a...>
Date: Tue, 4 Jun 2019 18:09:39 +0900 (JST)
Subject: [ruby-changes:55994] Nobuyoshi Nakada: b0c35ff2db (trunk): colorize.rb: fix reading from test/colors
https://git.ruby-lang.org/ruby.git/commit/?id=b0c35ff2db From b0c35ff2db3a4ebb12a405705592e938f50bff64 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Tue, 4 Jun 2019 17:23:57 +0900 Subject: colorize.rb: fix reading from test/colors [ci skip] diff --git a/tool/colorize.rb b/tool/colorize.rb index 73dd9e5..ed79858 100644 --- a/tool/colorize.rb +++ b/tool/colorize.rb @@ -6,13 +6,14 @@ class Colorize https://github.com/ruby/ruby/blob/trunk/tool/colorize.rb#L6 if color or (color == nil && STDOUT.tty?) 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]*)/)] : {} + 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 + rescue Errno::ENOENT end + @colors = colors @reset = "#{@beg}m" end end -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/