Commit 6dd2debe authored by Fabio Pelosin's avatar Fabio Pelosin

[Project] Group subspecs in a group to avoid name collisions with other groups

Otherwise a subspec named resources would be added to the resources
group already used to store the resources of the main spec
parent c30d5c63
...@@ -92,6 +92,8 @@ module Pod ...@@ -92,6 +92,8 @@ module Pod
:resources => 'Resources', :resources => 'Resources',
:frameworks_and_libraries => 'Frameworks & Libraries', :frameworks_and_libraries => 'Frameworks & Libraries',
:support_files => 'Support Files', :support_files => 'Support Files',
:subspecs => 'Subspecs',
:products => 'Products',
} }
# Returns the group for the specification with the give name creating it if # Returns the group for the specification with the give name creating it if
...@@ -200,7 +202,8 @@ module Pod ...@@ -200,7 +202,8 @@ module Pod
if spec_name != pod_name if spec_name != pod_name
subspecs_names = spec_name.gsub(pod_name + '/', '').split('/') subspecs_names = spec_name.gsub(pod_name + '/', '').split('/')
subspecs_names.each do |name| subspecs_names.each do |name|
group = group[name] || group.new_group(name) subspecs_group = group[SPEC_SUBGROUPS[:subspecs]] || group.new_group(SPEC_SUBGROUPS[:subspecs])
group = subspecs_group[name] || subspecs_group.new_group(name)
end end
end end
group group
......
Subproject commit d4f858d2312d84900f6dd8316e88250745ed856d Subproject commit 3c332e5b09ae00b1ddf42994fe9d8b3d22bdd652
...@@ -107,24 +107,24 @@ module Pod ...@@ -107,24 +107,24 @@ module Pod
end end
it "returns the group for the spec with the given name" do it "returns the group for the spec with the given name" do
group = @project.group_for_spec('BananaLib/Subspec') group = @project.group_for_spec('BananaLib/Tree')
group.hierarchy_path.should == '/Pods/BananaLib/Subspec' group.hierarchy_path.should == '/Pods/BananaLib/Subspecs/Tree'
end end
it "returns the requested subgroup" do it "returns the requested subgroup" do
group = @project.group_for_spec('BananaLib/Subspec', :source_files) group = @project.group_for_spec('BananaLib/Tree', :source_files)
group.hierarchy_path.should == '/Pods/BananaLib/Subspec/Source Files' group.hierarchy_path.should == '/Pods/BananaLib/Subspecs/Tree/Source Files'
end end
it "raises if unable to recognize the subgroup key" do it "raises if unable to recognize the subgroup key" do
should.raise ArgumentError do should.raise ArgumentError do
@project.group_for_spec('BananaLib/Subspec', :unknown) @project.group_for_spec('BananaLib/Tree', :unknown)
end.message.should.match /Unrecognized subgroup/ end.message.should.match /Unrecognized subgroup/
end end
it "doesn't duplicate the groups" do it "doesn't duplicate the groups" do
group_1 = @project.group_for_spec('BananaLib/Subspec', :source_files) group_1 = @project.group_for_spec('BananaLib/Tree', :source_files)
group_2 = @project.group_for_spec('BananaLib/Subspec', :source_files) group_2 = @project.group_for_spec('BananaLib/Tree', :source_files)
group_1.uuid.should == group_2.uuid group_1.uuid.should == group_2.uuid
end end
end end
...@@ -221,7 +221,7 @@ module Pod ...@@ -221,7 +221,7 @@ module Pod
it "returns the group for subspecs" do it "returns the group for subspecs" do
group = @project.send(:spec_group, 'JSONKit/Parsing') group = @project.send(:spec_group, 'JSONKit/Parsing')
group.hierarchy_path.should == '/Pods/JSONKit/Parsing' group.hierarchy_path.should == '/Pods/JSONKit/Subspecs/Parsing'
end end
end end
......
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