Commit de263101 authored by Luke Redpath's avatar Luke Redpath

Resolver is never created with a second argument.

Renamed method argument to make it clear it takes a podfile or a spec.
parent d3ca9798
......@@ -124,7 +124,7 @@ module Pod
end
def dependent_specifications
@dependent_specifications ||= Resolver.new(@podfile, @definition ? @definition.dependencies : nil).resolve
@dependent_specifications ||= Resolver.new(@podfile).resolve
end
def build_specifications
......
module Pod
class Resolver
def initialize(podfile, dependencies = nil)
@podfile, @dependencies = podfile, dependencies || podfile.dependencies
def initialize(podfile)
@podfile = podfile
end
def resolve
@sets, @loaded_spec_names, @specs = [], [], []
find_dependency_sets(@podfile, @dependencies)
find_dependency_sets(@podfile)
@specs.sort_by(&:name)
end
def find_dependency_sets(podfile, dependencies = nil)
(dependencies || podfile.dependencies).each do |dependency|
# this can be called with anything that has dependencies
# e.g. a Specification or a Podfile.
def find_dependency_sets(has_dependencies)
has_dependencies.dependencies.each do |dependency|
set = find_dependency_set(dependency)
set.required_by(podfile)
set.required_by(has_dependencies)
unless @loaded_spec_names.include?(dependency.name)
# Get a reference to the spec that’s actually being loaded.
# If it’s a subspec dependency, e.g. 'RestKit/Network', then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment