Commit 0da6c35f authored by Eloy Durán's avatar Eloy Durán

When operating on all pods, make them unique. Fixes #376.

parent 5690b44c
......@@ -23,7 +23,7 @@ module Pod
# Add all source files to the project grouped by pod
pod.relative_source_files_by_spec.each do |spec, paths|
parent_group = pod.local? ? @project.local_pods : @project.pods
group = @project.add_spec_to_group(pod.name, parent_group)
group = @project.add_spec_group(pod.name, parent_group)
paths.each do |path|
group.files.new('path' => path.to_s)
end
......@@ -186,7 +186,7 @@ module Pod
# @return [Array<LocalPod>] A list of LocalPod instances for each
# dependency that is not a download-only one.
def pods
pods_by_target.values.flatten
pods_by_target.values.flatten.uniq
end
def pods_by_target
......
......@@ -40,11 +40,11 @@ module Pod
end
# Adds a group as child to the `Pods' group namespacing subspecs.
def add_spec_to_group(name, parent_group)
def add_spec_group(name, parent_group)
groups = parent_group.groups
group = nil
name.split('/').each do |name|
group = groups.find { |g| g.name == name } || groups.new({ 'name' => name })
group = groups.find { |g| g.name == name } || groups.new('name' => name)
groups = group.groups
end
group
......
Subproject commit 6116b0a386a0313d7183ea219be1b51d56962546
Subproject commit 28e0d9209ab777d227783f1f0cad6ce096d0d6a8
......@@ -75,8 +75,8 @@ module Pod
group.files.map(&:name).should == ["Reachability.h", "Reachability.m"]
end
it "it list a pod only once" do
reachability_pods = @installer.pods.map(&:to_s).select{|s| s.include?('Reachability')}
it "lists a pod only once" do
reachability_pods = @installer.pods.map(&:to_s).select{|s| s.include?('Reachability') }
reachability_pods.count.should == 1
end
......
......@@ -12,7 +12,7 @@ describe 'Pod::Project' do
end
it "adds a group to the `Pods' group" do
group = @project.add_spec_to_group('JSONKit', @project.pods)
group = @project.add_spec_group('JSONKit', @project.pods)
@project.pods.child_references.should.include group.uuid
find_object({
'isa' => 'PBXGroup',
......@@ -23,7 +23,7 @@ describe 'Pod::Project' do
end
it "namespaces subspecs in groups" do
group = @project.add_spec_to_group('JSONKit/Subspec', @project.pods)
group = @project.add_spec_group('JSONKit/Subspec', @project.pods)
@project.pods.groups.find { |g| g.name == 'JSONKit' }.child_references.should.include group.uuid
find_object({
'isa' => 'PBXGroup',
......
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