CocoaPods/Core — pull request #29 by nmccann (2013-10-10 14:03:33+00:00)
Title: Issue 1460 Subspec dependency checking should no longer produce false-po...

[Issue 1460](https://github.com/CocoaPods/CocoaPods/issues/1460) Subspec dependency checking should no longer produce false-positives

Previously, when defining dependencies in a pod spec, an error would be thrown if
the parent spec's name includes the dependency name (because it thinks a cyclic
dependency is created). For example, a pod spec named 'SpecTest' would incorrectly
fail if one of it's sub specs had a dependency on a pod named 'Spec'.

The new implementation looks for an exact match between a dependency's name and
all possible parents of the current subspec. For example if the name of a subspec's parent was
"Spec/Subspec/SubSubSpec", we would prevent the subspec from having a dependency on any
of the following:
* Spec
* Spec/Subspec
* Spec/Subspec/SubSubSpec

This requires breaking the name into it's components and then recomposing it one by one, which
results in some admittedly messy code, Ruby isn't my primary language so I'm likely missing something
that would condense some of this code.

Since we are now looking for an exact match, there shouldn't be any false positives arising from
having a dependency with a similar name as one of the parent specs.

Note: I was unsure of where to put unit tests but if someone would like to describe the process to me
I can try to add some.

This is more or less my first foray into contributing to an open-source library so please be gentle :)