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:
parent
9ed6875f93
commit
1bb9e42fa5
Notes:
git
2022-03-24 13:16:39 +09:00
1 changed files with 11 additions and 1 deletions
|
@ -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)})\)/
|
||||
|
|
Loading…
Reference in a new issue