summaryrefslogtreecommitdiffhomepage
path: root/tasks/mrbgem_spec.rake
diff options
context:
space:
mode:
authorDaniel Bovensiepen <[email protected]>2013-05-03 14:19:19 +0800
committerDaniel Bovensiepen <[email protected]>2013-05-03 14:19:19 +0800
commit1eb2a4b6c852b5de80acd98adec9d0cd71bcb791 (patch)
treeebebf6befae2a4054c587b4583c49ca3a612ad51 /tasks/mrbgem_spec.rake
parent822a71154f92fb39b6ea1a28f77f8b453d75e45d (diff)
downloadmruby-1eb2a4b6c852b5de80acd98adec9d0cd71bcb791.tar.gz
mruby-1eb2a4b6c852b5de80acd98adec9d0cd71bcb791.zip
Move GemList to MRuby::Gem::List. More logical location
Diffstat (limited to 'tasks/mrbgem_spec.rake')
-rw-r--r--tasks/mrbgem_spec.rake16
1 files changed, 16 insertions, 0 deletions
diff --git a/tasks/mrbgem_spec.rake b/tasks/mrbgem_spec.rake
index 7b6751390..2d61d5908 100644
--- a/tasks/mrbgem_spec.rake
+++ b/tasks/mrbgem_spec.rake
@@ -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