Commit dd8bfcb4 authored by Daniel Bovensiepen's avatar Daniel Bovensiepen

Implement GemList which can identify GEM duplicates

parent 0e529c22
module MRuby 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 module LoadGems
def gembox(gemboxfile) def gembox(gemboxfile)
gembox = File.expand_path("#{gemboxfile}.gembox", "#{MRUBY_ROOT}/mrbgems") gembox = File.expand_path("#{gemboxfile}.gembox", "#{MRUBY_ROOT}/mrbgems")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment