diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-05-04 01:23:41 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-05-04 01:23:41 +0900 |
| commit | 7d134d941b37e0aaa8f6c6630583b091f70b8354 (patch) | |
| tree | 77ce278fae7c048f0a97ddd283b50ce1047f742b /tasks/mrbgem_spec.rake | |
| parent | 8d338334761c8c920d83f72c9a1c0a5ccba88b39 (diff) | |
| parent | d0f491d8c3a0dee6a8218685af7fb7f2ee6cc581 (diff) | |
| download | mruby-7d134d941b37e0aaa8f6c6630583b091f70b8354.tar.gz mruby-7d134d941b37e0aaa8f6c6630583b091f70b8354.zip | |
Merge branch 'bovi-gem-duplication'
Diffstat (limited to 'tasks/mrbgem_spec.rake')
| -rw-r--r-- | tasks/mrbgem_spec.rake | 24 |
1 files changed, 24 insertions, 0 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 |
