diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2015-06-22 10:04:00 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2015-06-22 10:04:00 +0900 |
| commit | c8229dbd19da9a3e92d69e8d6ecc820aa2b18d53 (patch) | |
| tree | 0750d854f7f8509e18c61d6caa989d75e8d93605 /tasks/mruby_build_gem.rake | |
| parent | 7cf94bac100931cd80ac0b851d3de298e351b5b9 (diff) | |
| parent | 078d24d4d3f7b5aac436fb70e341e1a7668fdbbb (diff) | |
| download | mruby-c8229dbd19da9a3e92d69e8d6ecc820aa2b18d53.tar.gz mruby-c8229dbd19da9a3e92d69e8d6ecc820aa2b18d53.zip | |
Merge pull request #2846 from take-cheeze/mgem_mrbgem
Add :mgem gem loading.
Diffstat (limited to 'tasks/mruby_build_gem.rake')
| -rw-r--r-- | tasks/mruby_build_gem.rake | 20 |
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] |
