Search gem from MRUBY_ROOT if build config is in build_config.

This commit is contained in:
Yukihiro "Matz" Matsumoto
2020-10-31 22:25:17 +09:00
parent 9233d28ac7
commit ddfac9aba0
2 changed files with 13 additions and 3 deletions
+6 -2
View File
@@ -15,10 +15,14 @@ module MRuby
def gem(gemdir, &block)
if gemdir.is_a?(Hash)
gemdir = load_special_path_gem(gemdir)
elsif GemBox.path && gemdir.is_a?(String)
elsif GemBox.path
gemdir = File.expand_path(gemdir, File.dirname(GemBox.path))
else
gemdir = File.expand_path(gemdir, MRUBY_ROOT)
caller_dir = File.expand_path(File.dirname(caller(1,1)[0][/^(.*?):\d/,1]))
if caller_dir == "#{MRUBY_ROOT}/build_config"
caller_dir = MRUBY_ROOT
end
gemdir = File.expand_path(gemdir, caller_dir)
end
gemrake = File.join(gemdir, "mrbgem.rake")