summaryrefslogtreecommitdiffhomepage
path: root/tasks
diff options
context:
space:
mode:
authortake_cheeze <[email protected]>2015-06-22 02:23:11 +0900
committertake_cheeze <[email protected]>2015-06-22 02:23:11 +0900
commit8d54977d259137b61a4e391a3928374d1b29aca3 (patch)
tree3c5fd42096a99fc1c07bb027d51bd5d2cfffc463 /tasks
parent7cf94bac100931cd80ac0b851d3de298e351b5b9 (diff)
downloadmruby-8d54977d259137b61a4e391a3928374d1b29aca3.tar.gz
mruby-8d54977d259137b61a4e391a3928374d1b29aca3.zip
Add :mgem gem loader to load mrbgem from mgem-list ( https://github.com/mruby/mgem-list ).
Diffstat (limited to 'tasks')
-rw-r--r--tasks/mruby_build_gem.rake20
1 files changed, 20 insertions, 0 deletions
diff --git a/tasks/mruby_build_gem.rake b/tasks/mruby_build_gem.rake
index dbbade487..d9d2575bd 100644
--- a/tasks/mruby_build_gem.rake
+++ b/tasks/mruby_build_gem.rake
@@ -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]