summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-09-18 23:31:53 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-09-19 00:03:18 +0900
commit842f600a93deca71e908ef5bb16e4e6aed519890 (patch)
tree92cbb30c383f34f7f08b1d960de6b20ae5218fd7 /lib
parent15d5de59fb089eb47ca18dd4a7296fa2e7e73709 (diff)
Look up the language module
Look up language module with `MakeMakefile.[]`, insted of a accessing constant under that module directly, to get rid of expose the constant to the toplevel inadvertently.
Diffstat (limited to 'lib')
-rw-r--r--lib/mkmf.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 8df6e9ad59..ce72668501 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -2776,7 +2776,17 @@ distclean: clean distclean-so distclean-static distclean-rb-default distclean-rb
realclean: distclean
"
- module CXX
+ @lang = Hash.new(self)
+
+ def self.[](name)
+ @lang.fetch(name)
+ end
+
+ def self.[]=(name, mod)
+ @lang[name] = mod
+ end
+
+ self["C++"] = Module.new do
include MakeMakefile
extend self