diff options
| author | Daniel Bovensiepen <[email protected]> | 2013-05-03 14:19:19 +0800 |
|---|---|---|
| committer | Daniel Bovensiepen <[email protected]> | 2013-05-03 14:19:19 +0800 |
| commit | 1eb2a4b6c852b5de80acd98adec9d0cd71bcb791 (patch) | |
| tree | ebebf6befae2a4054c587b4583c49ca3a612ad51 /tasks | |
| parent | 822a71154f92fb39b6ea1a28f77f8b453d75e45d (diff) | |
| download | mruby-1eb2a4b6c852b5de80acd98adec9d0cd71bcb791.tar.gz mruby-1eb2a4b6c852b5de80acd98adec9d0cd71bcb791.zip | |
Move GemList to MRuby::Gem::List. More logical location
Diffstat (limited to 'tasks')
| -rw-r--r-- | tasks/mrbgem_spec.rake | 16 | ||||
| -rw-r--r-- | tasks/mruby_build.rake | 2 | ||||
| -rw-r--r-- | tasks/mruby_build_gem.rake | 16 |
3 files changed, 17 insertions, 17 deletions
diff --git a/tasks/mrbgem_spec.rake b/tasks/mrbgem_spec.rake index 7b6751390..2d61d5908 100644 --- a/tasks/mrbgem_spec.rake +++ b/tasks/mrbgem_spec.rake @@ -169,6 +169,22 @@ module MRuby end end # Specification + + class List < Array + def <<(gem) + fail ArgumentError.new("Don't find directory for this GEM") unless gem.respond_to? :dir + unless include?(gem) + super(gem) + else + # GEM was already added to this list + end + end + + # we assume that a gem with the same directory is equal + def include?(gem) + detect {|g| g.dir == gem.dir } + end + end # List end # Gem GemBox = Object.new diff --git a/tasks/mruby_build.rake b/tasks/mruby_build.rake index 9f77fd6b0..eeebd161b 100644 --- a/tasks/mruby_build.rake +++ b/tasks/mruby_build.rake @@ -75,7 +75,7 @@ module MRuby @mrbc = Command::Mrbc.new(self) @bins = %w(mrbc) - @gems, @libmruby = GemList.new, [] + @gems, @libmruby = MRuby::Gem::List.new, [] @build_mrbtest_lib_only = false MRuby.targets[@name] = self diff --git a/tasks/mruby_build_gem.rake b/tasks/mruby_build_gem.rake index b40522331..83c46de24 100644 --- a/tasks/mruby_build_gem.rake +++ b/tasks/mruby_build_gem.rake @@ -1,20 +1,4 @@ module MRuby - class GemList < Array - def <<(gem) - fail ArgumentError.new("Don't find directory for this GEM") unless gem.respond_to? :dir - unless include?(gem) - super(gem) - else - # GEM was already added to this list - end - end - - # we assume that a gem with the same directory is equal - def include?(gem) - detect {|g| g.dir == gem.dir } - end - end - module LoadGems def gembox(gemboxfile) gembox = File.expand_path("#{gemboxfile}.gembox", "#{MRUBY_ROOT}/mrbgems") |
