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

extlibs.rb: Add fallback Colorize

To get rid of an unnecessary dependency for the case using
in other repositories.
This commit is contained in:
Nobuyoshi Nakada 2022-03-19 22:44:28 +09:00
parent 9ed6875f93
commit 1bb9e42fa5
Notes: git 2022-03-24 13:16:39 +09:00

View file

@ -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)})\)/