[前][次][番号順一覧][スレッド一覧]

ruby-changes:55991

From: Nobuyoshi <ko1@a...>
Date: Tue, 4 Jun 2019 17:10:28 +0900 (JST)
Subject: [ruby-changes:55991] Nobuyoshi Nakada: 16cb1fb007 (trunk): extlibs.rb: colorize

https://git.ruby-lang.org/ruby.git/commit/?id=16cb1fb007

From 16cb1fb007a9d107b8c447e862c92c682a56a7c8 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Tue, 4 Jun 2019 17:09:16 +0900
Subject: extlibs.rb: colorize

[ci skip]

diff --git a/tool/extlibs.rb b/tool/extlibs.rb
index a840724..efae167 100755
--- a/tool/extlibs.rb
+++ b/tool/extlibs.rb
@@ -5,8 +5,13 @@ https://github.com/ruby/ruby/blob/trunk/tool/extlibs.rb#L5
 
 require 'digest'
 require_relative 'downloader'
+require_relative 'colorize'
 
 class ExtLibs
+  def initialize
+    @colorize = Colorize.new
+  end
+
   def cache_file(url, cache_dir)
     Downloader.cache_file(url, nil, :cache_dir => cache_dir)
   end
@@ -23,16 +28,12 @@ class ExtLibs https://github.com/ruby/ruby/blob/trunk/tool/extlibs.rb#L28
         $stdout.flush
       end
       hd = Digest(name.upcase).file(cache).hexdigest
-      if hd == sum
-        if $VERBOSE
-          $stdout.puts " OK"
-          $stdout.flush
-        end
-      else
-        if $VERBOSE
-          $stdout.puts " NG"
-          $stdout.flush
-        end
+      if $VERBOSE
+        $stdout.print " "
+        $stdout.puts hd == sum ? @colorize.pass("OK") : @colorize.fail("NG")
+        $stdout.flush
+      end
+      unless hd == sum
         raise "checksum mismatch: #{cache}, #{name}:#{hd}, expected #{sum}"
       end
     end
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]