diff options
| author | William Light <[email protected]> | 2013-10-01 21:26:04 +0200 |
|---|---|---|
| committer | William Light <[email protected]> | 2013-10-01 21:27:34 +0200 |
| commit | 72d6db8bc417ef966c5dff16b6baa885140c96dc (patch) | |
| tree | 6d03cb105413bcaf54309fd4dfae9035b10a18ba | |
| parent | 7c3f06ddd8cd61277e041b538da68fd5b8be9dde (diff) | |
| download | mruby-72d6db8bc417ef966c5dff16b6baa885140c96dc.tar.gz mruby-72d6db8bc417ef966c5dff16b6baa885140c96dc.zip | |
Fix for caller_dir relative gems
| -rw-r--r-- | tasks/mruby_build_gem.rake | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tasks/mruby_build_gem.rake b/tasks/mruby_build_gem.rake index 4b8b79682..ea1307132 100644 --- a/tasks/mruby_build_gem.rake +++ b/tasks/mruby_build_gem.rake @@ -8,17 +8,21 @@ module MRuby GemBox.path = gembox instance_eval File.read(gembox) + + GemBox.path = nil end def gem(gemdir, &block) 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}" + elsif GemBox.path && gemdir.is_a?(String) + gemdir = File.expand_path(gemdir, File.dirname(GemBox.path)) else gemdir = File.expand_path(gemdir, caller_dir) end + gemrake = File.join(gemdir, "mrbgem.rake") fail "Can't find #{gemrake}" unless File.exists?(gemrake) |
