Add `:path` option for git repository.
MODIFY
doc/guides/mrbgems.md
doc/guides/mrbgems.md
@@ -26,6 +26,11 @@ conf.gem :github => 'masuidrive/mrbgems-example', :branch => 'master'
conf.gem :bitbucket => 'mruby/mrbgems-example', :branch => 'master'
```
+You can specify the sub directory of the repository with `:path` option:
+```ruby
+conf.gem github: 'mruby/mruby', path: 'mrbgems/mruby-socket'
+```
+
To use mrbgem from [mgem-list](https://github.com/mruby/mgem-list) use `:mgem` option:
```ruby
conf.gem :mgem => 'mruby-yaml'

MODIFY
lib/mruby/build/load_gems.rb
lib/mruby/build/load_gems.rb
@@ -76,9 +76,6 @@ module MRuby
if params[:core]
gemdir = "#{root}/mrbgems/#{params[:core]}"
- elsif params[:path]
- require 'pathname'
- gemdir = Pathname.new(params[:path]).absolute? ? params[:path] : "#{root}/#{params[:path]}"
elsif params[:git]
url = params[:git]
gemdir = "#{gem_clone_dir}/#{url.match(/([-\w]+)(\.[-\w]+|)$/).to_a[1]}"
@@ -108,6 +105,11 @@ module MRuby
# Jump to the top of the branch
git.run_checkout gemdir, branch if $pull_gems
end
+
+ gemdir << "/#{params[:path]}" if params[:path]
+ elsif params[:path]
+ require 'pathname'
+ gemdir = Pathname.new(params[:path]).absolute? ? params[:path] : "#{root}/#{params[:path]}"
else
fail "unknown gem option #{params}"
end

Add `:path` option for git repository.