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

extlibs.rb: colorize

[ci skip]
This commit is contained in:
Nobuyoshi Nakada 2019-06-04 17:09:16 +09:00
parent 58fd27d3d8
commit 16cb1fb007
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60

View file

@ -5,8 +5,13 @@
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
$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.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