1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

generic_erb.rb: ignore error

* tool/generic_erb.rb: ignore error that tput is not found.
  [ruby-core:71143] [Bug #11611]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-10-22 08:56:30 +00:00
parent a356fe1c35
commit 30b839a013

View file

@ -24,7 +24,7 @@ end
unchanged = "unchanged"
updated = "updated"
if color or (color == nil && STDOUT.tty?)
if /\A(\e\[).*m\z/ =~ IO.popen("tput smso", "r", &:read)
if (/\A(\e\[).*m\z/ =~ IO.popen("tput smso", "r", err: IO::NULL, &:read) rescue nil)
beg = $1
colors = (colors = ENV['TEST_COLORS']) ? Hash[colors.scan(/(\w+)=([^:\n]*)/)] : {}
reset = "#{beg}m"