2013-01-07 14:06:34 -06:00
|
|
|
class Dependencies
|
|
|
|
include Enumerable
|
|
|
|
|
|
|
|
def initialize(*args)
|
|
|
|
@deps = Array.new(*args)
|
|
|
|
end
|
|
|
|
|
|
|
|
def each(*args, &block)
|
|
|
|
@deps.each(*args, &block)
|
|
|
|
end
|
2012-02-28 19:56:29 -08:00
|
|
|
|
2012-10-24 18:17:43 -05:00
|
|
|
def <<(o)
|
2013-01-07 14:06:34 -06:00
|
|
|
@deps << o unless @deps.include? o
|
|
|
|
self
|
|
|
|
end
|
|
|
|
|
|
|
|
def empty?
|
|
|
|
@deps.empty?
|
|
|
|
end
|
|
|
|
|
|
|
|
def *(arg)
|
|
|
|
@deps * arg
|
2012-10-24 18:17:43 -05:00
|
|
|
end
|
2013-01-07 18:16:11 -06:00
|
|
|
|
2013-01-23 00:26:30 -06:00
|
|
|
def to_a
|
2013-01-07 18:16:11 -06:00
|
|
|
@deps
|
|
|
|
end
|
2013-01-23 00:26:30 -06:00
|
|
|
alias_method :to_ary, :to_a
|
2012-10-24 18:17:43 -05:00
|
|
|
end
|