lib/build/dependency/provider.rb in build-dependency-1.2.1 vs lib/build/dependency/provider.rb in build-dependency-1.3.0
- old
+ new
@@ -26,19 +26,31 @@
klass.include(Provider)
end
# A provision is a thing which satisfies a dependency.
Provision = Struct.new(:name, :provider, :value) do
+ def each_dependency(&block)
+ self.provider.dependencies.each(&block)
+ end
+
def alias?
false
end
def to_s
"provides #{name.inspect}"
end
end
Alias = Struct.new(:name, :provider, :dependencies) do
+ def each_dependency(&block)
+ return to_enum(&block) unless block_given?
+
+ dependencies.each do |name|
+ yield Depends.new(name)
+ end
+ end
+
def alias?
true
end
def to_s