mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Add :mgem gem loader to load mrbgem from mgem-list ( https://github.com/mruby/mgem-list ).
This commit is contained in:
@@ -52,6 +52,26 @@ module MRuby
|
||||
else
|
||||
params[:git] = "https://bitbucket.org/#{params[:bitbucket]}.git"
|
||||
end
|
||||
elsif params[:mgem]
|
||||
mgem_list_dir = "#{gem_clone_dir}/mgem-list"
|
||||
mgem_list_url = 'https://github.com/mruby/mgem-list.git'
|
||||
if File.exist? mgem_list_dir
|
||||
git.run_pull mgem_list_dir, mgem_list_url if $pull_gems
|
||||
else
|
||||
FileUtils.mkdir_p mgem_list_dir
|
||||
git.run_clone mgem_list_dir, mgem_list_url
|
||||
end
|
||||
|
||||
require 'yaml'
|
||||
|
||||
conf_path = "#{mgem_list_dir}/#{params[:mgem]}.gem"
|
||||
conf_path = "#{mgem_list_dir}/mruby-#{params[:mgem]}.gem" unless File.exist? conf_path
|
||||
fail "mgem not found: #{params[:mgem]}" unless File.exist? conf_path
|
||||
conf = YAML.load File.read conf_path
|
||||
|
||||
fail "unknown mgem protocol: #{conf['protocol']}" if conf['protocol'] != 'git'
|
||||
params[:git] = conf['repository']
|
||||
params[:branch] = conf['branch"] if conf["branch']
|
||||
end
|
||||
|
||||
if params[:core]
|
||||
|
||||
Reference in New Issue
Block a user