summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2013-05-04 01:23:41 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2013-05-04 01:23:41 +0900
commit7d134d941b37e0aaa8f6c6630583b091f70b8354 (patch)
tree77ce278fae7c048f0a97ddd283b50ce1047f742b
parent8d338334761c8c920d83f72c9a1c0a5ccba88b39 (diff)
parentd0f491d8c3a0dee6a8218685af7fb7f2ee6cc581 (diff)
downloadmruby-7d134d941b37e0aaa8f6c6630583b091f70b8354.tar.gz
mruby-7d134d941b37e0aaa8f6c6630583b091f70b8354.zip
Merge branch 'bovi-gem-duplication'
-rw-r--r--tasks/mrbgem_spec.rake24
-rw-r--r--tasks/mruby_build.rake2
2 files changed, 25 insertions, 1 deletions
diff --git a/tasks/mrbgem_spec.rake b/tasks/mrbgem_spec.rake
index 7d6a03fc1..d2dbc860c 100644
--- a/tasks/mrbgem_spec.rake
+++ b/tasks/mrbgem_spec.rake
@@ -169,6 +169,30 @@ module MRuby
end
end # Specification
+
+ class List
+ include Enumerable
+
+ def initialize
+ @ary = []
+ end
+
+ def each(&b)
+ @ary.each(&b)
+ end
+
+ def <<(gem)
+ unless @ary.detect {|g| g.dir == gem.dir }
+ @ary << gem
+ else
+ # GEM was already added to this list
+ end
+ end
+
+ def empty?
+ @ary.empty?
+ end
+ end # List
end # Gem
GemBox = Object.new
diff --git a/tasks/mruby_build.rake b/tasks/mruby_build.rake
index 4a8dcf99b..eeebd161b 100644
--- a/tasks/mruby_build.rake
+++ b/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