mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Move GemList to MRuby::Gem::List. More logical location
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -75,7 +75,7 @@ module MRuby
|
||||
@mrbc = Command::Mrbc.new(self)
|
||||
|
||||
@bins = %w(mrbc)
|
||||
@gems, @libmruby = GemList.new, []
|
||||
@gems, @libmruby = MRuby::Gem::List.new, []
|
||||
@build_mrbtest_lib_only = false
|
||||
|
||||
MRuby.targets[@name] = self
|
||||
|
||||
@@ -1,20 +1,4 @@
|
||||
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
|
||||
def gembox(gemboxfile)
|
||||
gembox = File.expand_path("#{gemboxfile}.gembox", "#{MRUBY_ROOT}/mrbgems")
|
||||
|
||||
Reference in New Issue
Block a user