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
745ca34e
Commit
745ca34e
authored
Mar 24, 2012
by
Eloy Duran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get search info from the spec that the found spec is a part of. Fixes #177.
parent
7b619aea
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
3 deletions
+16
-3
search.rb
lib/cocoapods/command/search.rb
+4
-3
specification.rb
lib/cocoapods/specification.rb
+7
-0
specification_spec.rb
spec/unit/specification_spec.rb
+5
-0
No files found.
lib/cocoapods/command/search.rb
View file @
745ca34e
...
...
@@ -28,10 +28,11 @@ module Pod
def
run
Source
.
search_by_name
(
@query
.
strip
,
@full_text_search
).
each
do
|
set
|
puts
"
\e
[32m-->
#{
set
.
name
}
(
#{
set
.
versions
.
reverse
.
join
(
", "
)
}
)
\e
[0m"
puts_wrapped_text
(
set
.
specification
.
summary
)
puts_detail
(
'Homepage'
,
set
.
specification
.
homepage
)
source
=
set
.
specification
.
source
?
set
.
specification
.
source
.
values
[
0
]
:
nil
spec
=
set
.
specification
.
part_of_other_pod?
?
set
.
specification
.
part_of_specification
:
set
.
specification
source
=
spec
.
source
.
values
.
first
puts_detail
(
'Homepage'
,
spec
.
homepage
)
puts_detail
(
'Source'
,
source
)
puts_github_info
(
source
)
if
@stats
...
...
lib/cocoapods/specification.rb
View file @
745ca34e
...
...
@@ -173,6 +173,13 @@ module Pod
# This is assigned the other spec, of which this pod's source is a part, by
# a Resolver.
attr_accessor
:part_of_specification
def
part_of_specification
@part_of_specification
||
begin
set
=
Source
.
search
(
@part_of
)
set
.
required_by
(
self
)
set
.
specification
end
end
def
wrapper?
source_files
.
empty?
&&
!
subspecs
.
empty?
...
...
spec/unit/specification_spec.rb
View file @
745ca34e
...
...
@@ -124,6 +124,11 @@ describe "A Pod::Specification that's part of another pod's source" do
@spec
.
dependencies
.
should
==
[
Pod
::
Dependency
.
new
(
'monkey'
,
'>= 1'
)]
end
it
"searches the sources for a matching specification if it has not been assigned by the Resolver yet (e.g. the search command)"
do
@spec
.
part_of_dependency
=
'SSZipArchive'
,
'0.1.1'
@spec
.
part_of_specification
.
to_s
.
should
==
'SSZipArchive (0.1.1)'
end
# TODO
#it "returns the specification of the pod that it's part of" do
# @spec.part_of_specification
...
...
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