diff options
author | Nobuyoshi Nakada <[email protected]> | 2022-03-19 22:44:28 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2022-03-24 13:16:13 +0900 |
commit | 1bb9e42fa5e4ea1b87ae35cb7de2baef5e1b15f1 (patch) | |
tree | 8a8fca6b1f32f78659fc5f2060c7665d7a07f91b /tool/extlibs.rb | |
parent | 9ed6875f9310be737ceca9b3034bbb34f1498068 (diff) |
extlibs.rb: Add fallback `Colorize`
To get rid of an unnecessary dependency for the case using
in other repositories.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/5701
Diffstat (limited to 'tool/extlibs.rb')
-rwxr-xr-x | tool/extlibs.rb | 12 |
1 files changed, 11 insertions, 1 deletions
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 @@ 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)})\)/ |