Commit 1eb2a4b6 authored by Daniel Bovensiepen's avatar Daniel Bovensiepen

Move GemList to MRuby::Gem::List. More logical location

parent 822a7115
...@@ -169,6 +169,22 @@ module MRuby ...@@ -169,6 +169,22 @@ module MRuby
end end
end # Specification 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 end # Gem
GemBox = Object.new GemBox = Object.new
......
...@@ -75,7 +75,7 @@ module MRuby ...@@ -75,7 +75,7 @@ module MRuby
@mrbc = Command::Mrbc.new(self) @mrbc = Command::Mrbc.new(self)
@bins = %w(mrbc) @bins = %w(mrbc)
@gems, @libmruby = GemList.new, [] @gems, @libmruby = MRuby::Gem::List.new, []
@build_mrbtest_lib_only = false @build_mrbtest_lib_only = false
MRuby.targets[@name] = self MRuby.targets[@name] = self
......
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