summaryrefslogtreecommitdiffhomepage
path: root/tasks
diff options
context:
space:
mode:
authortake_cheeze <[email protected]>2015-06-22 02:23:52 +0900
committertake_cheeze <[email protected]>2015-06-22 02:23:52 +0900
commit0c8fa845e4faf83c50b0df0272c58870832d9e62 (patch)
treedfc24bd777ea764bbd1e110d3ff236c048340417 /tasks
parent8d54977d259137b61a4e391a3928374d1b29aca3 (diff)
downloadmruby-0c8fa845e4faf83c50b0df0272c58870832d9e62.tar.gz
mruby-0c8fa845e4faf83c50b0df0272c58870832d9e62.zip
Load missing dependencies from core or mgem-list.
Diffstat (limited to 'tasks')
-rw-r--r--tasks/mrbgem_spec.rake15
1 files changed, 13 insertions, 2 deletions
diff --git a/tasks/mrbgem_spec.rake b/tasks/mrbgem_spec.rake
index e6e17e182..e22a39e19 100644
--- a/tasks/mrbgem_spec.rake
+++ b/tasks/mrbgem_spec.rake
@@ -304,7 +304,14 @@ module MRuby
default_gems = []
each do |g|
g.dependencies.each do |dep|
- default_gems << dep if dep[:default] and not gem_table.key? dep[:gem]
+ unless gem_table.key? dep[:gem]
+ if dep[:default]; default_gems << dep
+ elsif File.exist? "#{root}/mrbgems/#{dep[:gem]}" # check core
+ default_gems << { :gem => dep[:gem], :default => { :core => dep[:gem] } }
+ else # fallback to mgem-list
+ default_gems << { :gem => dep[:gem], :default => { :mgem => dep[:gem] } }
+ end
+ end
end
end
@@ -316,7 +323,11 @@ module MRuby
spec.setup
spec.dependencies.each do |dep|
- default_gems << dep if dep[:default] and not gem_table.key? dep[:gem]
+ unless gem_table.key? dep[:gem]
+ if dep[:default]; default_gems << dep
+ else default_gems << { :gem => dep[:gem], :default => { :mgem => dep[:gem] } }
+ end
+ end
end
gem_table[spec.name] = spec
end