diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-05-04 01:09:56 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-05-04 01:09:56 +0900 |
| commit | c304887b503a5b2c961eeb9a468eb6c660b94fd8 (patch) | |
| tree | 3e92053d6ba68d67f5ac097512297e8b18d91289 | |
| parent | 4d3991e561cda90e3ce03aba7602fa62bf577393 (diff) | |
| parent | 1eb2a4b6c852b5de80acd98adec9d0cd71bcb791 (diff) | |
| download | mruby-c304887b503a5b2c961eeb9a468eb6c660b94fd8.tar.gz mruby-c304887b503a5b2c961eeb9a468eb6c660b94fd8.zip | |
Merge branch 'gem-duplication' of https://github.com/bovi/mruby into bovi-gem-duplication
| -rw-r--r-- | tasks/mrbgem_spec.rake | 16 | ||||
| -rw-r--r-- | tasks/mruby_build.rake | 2 |
2 files changed, 17 insertions, 1 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 4a8dcf99b..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 = [], [] + @gems, @libmruby = MRuby::Gem::List.new, [] @build_mrbtest_lib_only = false MRuby.targets[@name] = self |
