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

This commit is contained in:
Yukihiro "Matz" Matsumoto
2013-05-04 01:09:56 +09:00
2 changed files with 17 additions and 1 deletions
+16
View File
@@ -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
+1 -1
View File
@@ -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