mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #3974 from take-cheeze/repo_path
Add `:path` option for git repository.
This commit is contained in:
@@ -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'
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user