diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-05-02 10:12:07 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-05-02 10:12:07 +0900 |
| commit | 3d149f6350a9fb00e8f28fd0cb527d53ec5aec9c (patch) | |
| tree | 3438cb01ec5518b9fc8f3a4e15fb199f2050b42a /tasks/mruby_build_gem.rake | |
| parent | a092e4102066bb1a039fdccbd301d44f69114648 (diff) | |
| parent | fd2e32e971a59ff3b20d7f5fede2aa4dd3c8263d (diff) | |
| download | mruby-3d149f6350a9fb00e8f28fd0cb527d53ec5aec9c.tar.gz mruby-3d149f6350a9fb00e8f28fd0cb527d53ec5aec9c.zip | |
Merge branch 'master' of github.com:mruby/mruby
Diffstat (limited to 'tasks/mruby_build_gem.rake')
| -rw-r--r-- | tasks/mruby_build_gem.rake | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tasks/mruby_build_gem.rake b/tasks/mruby_build_gem.rake index 993591efd..83c46de24 100644 --- a/tasks/mruby_build_gem.rake +++ b/tasks/mruby_build_gem.rake @@ -10,7 +10,7 @@ module MRuby 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_external_gem(gemdir) + gemdir = load_special_path_gem(gemdir) else gemdir = File.expand_path(gemdir, caller_dir) end @@ -28,14 +28,16 @@ module MRuby Gem.current end - def load_external_gem(params) + def load_special_path_gem(params) if params[:github] params[:git] = "https://github.com/#{params[:github]}.git" elsif params[:bitbucket] params[:git] = "https://bitbucket.org/#{params[:bitbucket]}.git" end - if params[:git] + if params[:core] + gemdir = "#{root}/mrbgems/#{params[:core]}" + elsif params[:git] url = params[:git] gemdir = "build/mrbgems/#{url.match(/([-_\w]+)(\.[-_\w]+|)$/).to_a[1]}" return gemdir if File.exists?(gemdir) @@ -45,11 +47,11 @@ module MRuby FileUtils.mkdir_p "build/mrbgems" git.run_clone gemdir, url, options - - gemdir else fail "unknown gem option #{params}" end + + gemdir end def enable_gems? |
