Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'gem-duplication' of https://github.com/bovi/mruby into …

…bovi-gem-duplication
  • Loading branch information...
commit c304887b503a5b2c961eeb9a468eb6c660b94fd8 2 parents 4d3991e + 1eb2a4b
@matz matz authored
Showing with 17 additions and 1 deletion.
  1. +16 −0 tasks/mrbgem_spec.rake
  2. +1 −1  tasks/mruby_build.rake
View
16 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
View
2  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
Please sign in to comment.
Something went wrong with that request. Please try again.