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
07a7560c
Commit
07a7560c
authored
Oct 22, 2014
by
Samuel E. Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Documentation] Document Molinillo module methods
parent
edc4f9f7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
0 deletions
+55
-0
resolver.rb
lib/cocoapods/resolver.rb
+55
-0
No files found.
lib/cocoapods/resolver.rb
View file @
07a7560c
...
@@ -93,6 +93,13 @@ module Pod
...
@@ -93,6 +93,13 @@ module Pod
include
Molinillo
::
SpecificationProvider
include
Molinillo
::
SpecificationProvider
# Returns (and caches) the specification that satisfy the given dependency.
#
# @return [Array<Specification>] the specifications that satisfy the given
# `dependency`.
#
# @param [Dependency] dependency the dependency that is being searched for.
#
def
search_for
(
dependency
)
def
search_for
(
dependency
)
@search
||=
{}
@search
||=
{}
@search
[
dependency
]
||=
begin
@search
[
dependency
]
||=
begin
...
@@ -114,6 +121,13 @@ module Pod
...
@@ -114,6 +121,13 @@ module Pod
@search
[
dependency
].
dup
@search
[
dependency
].
dup
end
end
# Returns the dependencies of `specification`.
#
# @return [Array<Specification>] all dependencies of `specification`.
#
# @param [Specification] specification the specification whose own
# dependencies are being asked for.
#
def
dependencies_for
(
specification
)
def
dependencies_for
(
specification
)
specification
.
all_dependencies
.
map
do
|
dependency
|
specification
.
all_dependencies
.
map
do
|
dependency
|
if
dependency
.
root_name
==
Specification
.
root_name
(
specification
.
name
)
if
dependency
.
root_name
==
Specification
.
root_name
(
specification
.
name
)
...
@@ -124,14 +138,42 @@ module Pod
...
@@ -124,14 +138,42 @@ module Pod
end
end
end
end
# Returns the name for the given `dependency`.
#
# @return [String] the name for the given `dependency`.
#
# @param [Dependency] dependency the dependency whose name is being
# queried.
#
def
name_for
(
dependency
)
def
name_for
(
dependency
)
dependency
.
name
dependency
.
name
end
end
# @return [String] the user-facing name for a {Podfile}.
#
def
name_for_explicit_dependency_source
def
name_for_explicit_dependency_source
'Podfile'
'Podfile'
end
end
# @return [String] the user-facing name for a {Lockfile}.
#
def
name_for_locking_dependency_source
'Podfile.lock'
end
# Determines whether the given `requirement` is satisfied by the given
# `spec`, in the context of the current `activated` dependency graph.
#
# @return [Boolean] whether `requirement` is satisfied by `spec` in the
# context of the current `activated` dependency graph.
#
# @param [Dependency] requirement the dependency in question.
#
# @param [Molinillo::DependencyGraph] activated the current dependency
# graph in the resolution process.
#
# @param [Specification] spec the specification in question.
#
def
requirement_satisfied_by?
(
requirement
,
activated
,
spec
)
def
requirement_satisfied_by?
(
requirement
,
activated
,
spec
)
existing_vertices
=
activated
.
vertices
.
values
.
select
do
|
v
|
existing_vertices
=
activated
.
vertices
.
values
.
select
do
|
v
|
Specification
.
root_name
(
v
.
name
)
==
requirement
.
root_name
Specification
.
root_name
(
v
.
name
)
==
requirement
.
root_name
...
@@ -152,6 +194,15 @@ module Pod
...
@@ -152,6 +194,15 @@ module Pod
# 3) Are there any conflicts for this dependency?
# 3) Are there any conflicts for this dependency?
# 4) How many possibilities are there to satisfy this dependency?
# 4) How many possibilities are there to satisfy this dependency?
#
#
# @return [Array<Dependency>] the sorted dependencies.
#
# @param [Array<Dependency>] dependencies the unsorted dependencies.
#
# @param [Molinillo::DependencyGraph] activated the dependency graph of
# currently activated specs.
#
# @param [{String => Array<Conflict>}] conflicts the current conflicts.
#
def
sort_dependencies
(
dependencies
,
activated
,
conflicts
)
def
sort_dependencies
(
dependencies
,
activated
,
conflicts
)
dependencies
.
sort_by
do
|
dependency
|
dependencies
.
sort_by
do
|
dependency
|
name
=
name_for
(
dependency
)
name
=
name_for
(
dependency
)
...
@@ -172,6 +223,10 @@ module Pod
...
@@ -172,6 +223,10 @@ module Pod
include
Molinillo
::
UI
include
Molinillo
::
UI
# The UI object the resolver should use for displaying user-facing output.
#
# @return [UserInterface] the normal CocoaPods UI object.
#
def
output
def
output
UI
UI
end
end
...
...
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