summaryrefslogtreecommitdiff
path: root/tool/extlibs.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2022-03-19 22:42:54 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2022-03-24 13:16:13 +0900
commit9ed6875f9310be737ceca9b3034bbb34f1498068 (patch)
tree77b83b5c7a53c53d926ce2a82e4bce1d90b1f866 /tool/extlibs.rb
parent247f8ecfa441b120ad8cb43fa1f3a96145814cd1 (diff)
downloadruby-9ed6875f9310be737ceca9b3034bbb34f1498068.tar.gz
extlibs.rb: Enclose `Vars` in `ExtLibs` class
To get rid of an unnecessary top-level constant for the case using as a library.
Diffstat (limited to 'tool/extlibs.rb')
-rwxr-xr-xtool/extlibs.rb22
1 files changed, 11 insertions, 11 deletions
diff --git a/tool/extlibs.rb b/tool/extlibs.rb
index ff1d154667..c6c6d0cf65 100755
--- a/tool/extlibs.rb
+++ b/tool/extlibs.rb
@@ -7,21 +7,21 @@ require 'digest'
require_relative 'downloader'
require_relative 'lib/colorize'
-class Vars < Hash
- def pattern
- /\$\((#{Regexp.union(keys)})\)/
- end
+class ExtLibs
+ class Vars < Hash
+ def pattern
+ /\$\((#{Regexp.union(keys)})\)/
+ end
- def expand(str)
- if empty?
- str
- else
- str.gsub(pattern) {self[$1]}
+ def expand(str)
+ if empty?
+ str
+ else
+ str.gsub(pattern) {self[$1]}
+ end
end
end
-end
-class ExtLibs
def initialize(mode = :all, cache_dir: nil)
@mode = mode
@cache_dir = cache_dir