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 ...@@ -124,7 +124,7 @@ module Pod
end end
def dependent_specifications def dependent_specifications
@dependent_specifications ||= Resolver.new(@podfile, @definition ? @definition.dependencies : nil).resolve @dependent_specifications ||= Resolver.new(@podfile).resolve
end end
def build_specifications def build_specifications
......
module Pod module Pod
class Resolver class Resolver
def initialize(podfile, dependencies = nil) def initialize(podfile)
@podfile, @dependencies = podfile, dependencies || podfile.dependencies @podfile = podfile
end end
def resolve def resolve
@sets, @loaded_spec_names, @specs = [], [], [] @sets, @loaded_spec_names, @specs = [], [], []
find_dependency_sets(@podfile, @dependencies) find_dependency_sets(@podfile)
@specs.sort_by(&:name) @specs.sort_by(&:name)
end end
def find_dependency_sets(podfile, dependencies = nil) # this can be called with anything that has dependencies
(dependencies || podfile.dependencies).each do |dependency| # 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 = find_dependency_set(dependency)
set.required_by(podfile) set.required_by(has_dependencies)
unless @loaded_spec_names.include?(dependency.name) unless @loaded_spec_names.include?(dependency.name)
# Get a reference to the spec that’s actually being loaded. # Get a reference to the spec that’s actually being loaded.
# If it’s a subspec dependency, e.g. 'RestKit/Network', then # 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