summaryrefslogtreecommitdiffhomepage
path: root/tasks
diff options
context:
space:
mode:
Diffstat (limited to 'tasks')
-rw-r--r--tasks/mrbgem_spec.rake2
-rw-r--r--tasks/mruby_build_gem.rake5
2 files changed, 7 insertions, 0 deletions
diff --git a/tasks/mrbgem_spec.rake b/tasks/mrbgem_spec.rake
index 94f24af26..70c44ed5e 100644
--- a/tasks/mrbgem_spec.rake
+++ b/tasks/mrbgem_spec.rake
@@ -297,6 +297,8 @@ module MRuby
GemBox = Object.new
class << GemBox
+ attr_accessor :path
+
def new(&block); block.call(self); end
def config=(obj); @config = obj; end
def gem(gemdir, &block); @config.gem(gemdir, &block); end
diff --git a/tasks/mruby_build_gem.rake b/tasks/mruby_build_gem.rake
index 39be984ad..4b8b79682 100644
--- a/tasks/mruby_build_gem.rake
+++ b/tasks/mruby_build_gem.rake
@@ -3,7 +3,10 @@ module MRuby
def gembox(gemboxfile)
gembox = File.expand_path("#{gemboxfile}.gembox", "#{MRUBY_ROOT}/mrbgems")
fail "Can't find gembox '#{gembox}'" unless File.exists?(gembox)
+
GemBox.config = self
+ GemBox.path = gembox
+
instance_eval File.read(gembox)
end
@@ -11,6 +14,8 @@ module MRuby
caller_dir = File.expand_path(File.dirname(/^(.*?):\d/.match(caller.first).to_a[1]))
if gemdir.is_a?(Hash)
gemdir = load_special_path_gem(gemdir)
+ elsif gemdir.is_a?(String)
+ gemdir = "#{File.dirname(GemBox.path)}/#{gemdir}"
else
gemdir = File.expand_path(gemdir, caller_dir)
end