ruby-changes:40314
From: nobu <ko1@a...>
Date: Sat, 31 Oct 2015 09:02:39 +0900 (JST)
Subject: [ruby-changes:40314] nobu:r52395 (trunk): ignore dump terminal
nobu 2015-10-31 09:02:19 +0900 (Sat, 31 Oct 2015) New Revision: 52395 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=52395 Log: ignore dump terminal * tool/generic_erb.rb, tool/ifchange: no colorization if tput returned nothing or dump terminal. Modified files: trunk/tool/generic_erb.rb trunk/tool/ifchange Index: tool/generic_erb.rb =================================================================== --- tool/generic_erb.rb (revision 52394) +++ tool/generic_erb.rb (revision 52395) @@ -24,7 +24,7 @@ end https://github.com/ruby/ruby/blob/trunk/tool/generic_erb.rb#L24 unchanged = "unchanged" updated = "updated" if color or (color == nil && STDOUT.tty?) - if (/\A(?:\e\[.*m|)\z/ =~ IO.popen("tput smso", "r", err: IO::NULL, &:read) rescue nil) + 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]*)/)] : {} reset = "#{beg}m" Index: tool/ifchange =================================================================== --- tool/ifchange (revision 52394) +++ tool/ifchange (revision 52395) @@ -48,7 +48,7 @@ msg_begin= msg_unchanged= msg_updated= m https://github.com/ruby/ruby/blob/trunk/tool/ifchange#L48 if [ "$color" = always -o \( "$color" = auto -a -t 1 \) ]; then msg_begin="[" case "`tput smso 2>/dev/null`" in - "$msg_begin"*m|"") + "$msg_begin"*m) if [ ${TEST_COLORS:+set} ]; then msg_unchanged=`expr ":$TEST_COLORS:" : ".*:pass=\([^:]*\):"` msg_updated=`expr ":$TEST_COLORS:" : ".*:fail=\([^:]*\):"` -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/