ruby-changes:71490
From: Nobuyoshi <ko1@a...>
Date: Thu, 24 Mar 2022 13:16:35 +0900 (JST)
Subject: [ruby-changes:71490] 1bb9e42fa5 (master): extlibs.rb: Add fallback `Colorize`
https://git.ruby-lang.org/ruby.git/commit/?id=1bb9e42fa5 From 1bb9e42fa5e4ea1b87ae35cb7de2baef5e1b15f1 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Sat, 19 Mar 2022 22:44:28 +0900 Subject: extlibs.rb: Add fallback `Colorize` To get rid of an unnecessary dependency for the case using in other repositories. --- tool/extlibs.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tool/extlibs.rb b/tool/extlibs.rb index c6c6d0cf65..5d1a2db143 100755 --- a/tool/extlibs.rb +++ b/tool/extlibs.rb @@ -5,9 +5,19 @@ https://github.com/ruby/ruby/blob/trunk/tool/extlibs.rb#L5 require 'digest' require_relative 'downloader' -require_relative 'lib/colorize' +begin + require_relative 'lib/colorize' +rescue LoadError +end class ExtLibs + unless defined?(Colorize) + class Colorize + def pass(str) str; end + def fail(str) str; end + end + end + class Vars < Hash def pattern /\$\((#{Regexp.union(keys)})\)/ -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/