diff options
Diffstat (limited to 'tasks')
| -rw-r--r-- | tasks/mrbgem_spec.rake | 7 | ||||
| -rw-r--r-- | tasks/mruby_build_gem.rake | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/tasks/mrbgem_spec.rake b/tasks/mrbgem_spec.rake index 564836630..eedc6480f 100644 --- a/tasks/mrbgem_spec.rake +++ b/tasks/mrbgem_spec.rake @@ -158,4 +158,11 @@ module MRuby end # Specification end # Gem + + GemBox = BasicObject.new + class << GemBox + def new(&block); block.call(self); end + def config=(obj); @config = obj; end + def gem(gemdir, &block); @config.gem(gemdir, &block); end + end # GemBox end # MRuby diff --git a/tasks/mruby_build_gem.rake b/tasks/mruby_build_gem.rake index 358df1612..10e9b9692 100644 --- a/tasks/mruby_build_gem.rake +++ b/tasks/mruby_build_gem.rake @@ -1,5 +1,12 @@ module MRuby module LoadGems + def gembox(gemboxfile) + gembox = File.absolute_path("#{gemboxfile}.gembox", "#{MRUBY_ROOT}/mrbgems") + fail "Can't find gembox '#{gembox}'" unless File.exists?(gembox) + GemBox.config = self + instance_eval File.read(gembox) + end + def gem(gemdir, &block) caller_dir = File.expand_path(File.dirname(/^(.*?):\d/.match(caller.first).to_a[1])) if gemdir.is_a?(Hash) |
