Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
cocoapods
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
cocoapods
Commits
98a447b4
Commit
98a447b4
authored
Nov 23, 2011
by
Eloy Duran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Retrieve the correct specification set for a subspec.
parent
bc3b1ce9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
1 deletion
+20
-1
dependency.rb
lib/cocoapods/dependency.rb
+7
-0
source.rb
lib/cocoapods/source.rb
+1
-1
dependency_spec.rb
spec/unit/dependency_spec.rb
+7
-0
source_spec.rb
spec/unit/source_spec.rb
+5
-0
No files found.
lib/cocoapods/dependency.rb
View file @
98a447b4
...
...
@@ -36,6 +36,13 @@ module Pod
(
@specification
?
@specification
==
other
.
specification
:
@external_spec_source
==
other
.
external_spec_source
)
end
# In case this is a dependency for a subspec, e.g. 'RestKit/Networking',
# this returns 'RestKit', which is what the Pod::Source needs to know to
# retrieve the correct Set from disk.
def
top_level_spec_name
@name
.
include?
(
'/'
)
?
@name
.
split
(
'/'
).
first
:
@name
end
def
to_s
version
=
''
if
source
=
@external_spec_source
...
...
lib/cocoapods/source.rb
View file @
98a447b4
...
...
@@ -42,7 +42,7 @@ module Pod
end
def
search
(
dependency
)
pod_sets
.
find
{
|
set
|
set
.
name
==
dependency
.
name
}
pod_sets
.
find
{
|
set
|
set
.
name
==
dependency
.
top_level_spec_
name
}
end
def
search_by_name
(
query
,
full_text_search
)
...
...
spec/unit/dependency_spec.rb
View file @
98a447b4
...
...
@@ -16,6 +16,13 @@ describe "Pod::Dependency" do
dep1
.
should
==
dep2
end
it
"returns the name of the dependency, or the name of the pod of which this is a subspec"
do
dep
=
Pod
::
Dependency
.
new
(
'RestKit'
)
dep
.
top_level_spec_name
.
should
==
'RestKit'
dep
=
Pod
::
Dependency
.
new
(
'RestKit/Networking'
)
dep
.
top_level_spec_name
.
should
==
'RestKit'
end
it
"is equal to another dependency if `external_spec_source' is the same"
do
dep1
=
Pod
::
Dependency
.
new
(
'bananas'
,
:git
=>
'GIT-URL'
)
dep2
=
Pod
::
Dependency
.
new
(
'bananas'
)
...
...
spec/unit/source_spec.rb
View file @
98a447b4
...
...
@@ -20,6 +20,11 @@ describe "Pod::Source" do
set
.
should
==
Pod
::
Spec
::
Set
.
by_pod_dir
(
config
.
repos_dir
+
'repo2/JSONKit'
)
end
it
"returns a specification set by top level spec name"
do
set
=
Pod
::
Source
.
search
(
Pod
::
Dependency
.
new
(
'JSONKit/SomeSubspec'
))
set
.
should
==
Pod
::
Spec
::
Set
.
by_pod_dir
(
config
.
repos_dir
+
'repo2/JSONKit'
)
end
it
"raises if a specification set can't be found"
do
lambda
{
Pod
::
Source
.
search
(
Pod
::
Dependency
.
new
(
'DoesNotExist'
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment