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
edc4f9f7
Commit
edc4f9f7
authored
Oct 22, 2014
by
Samuel E. Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[RuboCop] Yield to the style guide, even though I disagree with it in some cases.
parent
a92c46a7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
18 deletions
+36
-18
analyzer.rb
lib/cocoapods/installer/analyzer.rb
+15
-10
resolver.rb
lib/cocoapods/resolver.rb
+14
-6
lazy_specification.rb
lib/cocoapods/resolver/lazy_specification.rb
+7
-2
No files found.
lib/cocoapods/installer/analyzer.rb
View file @
edc4f9f7
...
...
@@ -234,37 +234,42 @@ module Pod
def
generate_version_locking_dependencies
require
'molinillo/dependency_graph'
dependency_graph
=
Molinillo
::
DependencyGraph
.
new
unless
update_mode
==
:all
||
!
lockfile
explicit_dependencies
=
lockfile
.
to_hash
[
'DEPENDENCIES'
]
||
[]
explicit_dependencies
.
each
do
|
string
|
dependency
=
Dependency
.
new
(
string
)
dependency_graph
.
add_root_vertex
(
dependency
.
name
,
nil
)
end
add_child_vertex
=
lambda
do
|
dependency_string
,
parents
|
dependency
=
Dependency
.
from_string
(
dependency_string
)
dependency_graph
.
add_child_vertex
(
dependency
.
name
,
parents
.
empty?
?
dependency
:
nil
,
parents
,
nil
)
dependency
end
add_to_dependency_graph
=
lambda
do
|
object
,
parents
|
case
object
when
String
dependency
=
Dependency
.
from_string
(
object
)
dependency_graph
.
add_child_vertex
(
dependency
.
name
,
parents
.
empty?
?
dependency
:
nil
,
parents
,
nil
)
add_child_vertex
.
call
(
object
,
parents
)
when
Hash
object
.
each
do
|
key
,
value
|
dependency
=
Dependency
.
from_string
(
key
)
dependency_graph
.
add_child_vertex
(
dependency
.
name
,
parents
.
empty?
?
dependency
:
nil
,
parents
,
nil
)
dependency
=
add_child_vertex
.
call
(
key
,
parents
)
value
.
each
{
|
v
|
add_to_dependency_graph
.
call
(
v
,
[
dependency
.
name
])
}
end
end
end
pods
=
lockfile
.
to_hash
[
'PODS'
]
||
[]
pods
.
each
do
|
p
|
add_to_dependency_graph
.
call
(
p
,
[])
pods
.
each
do
|
p
od
|
add_to_dependency_graph
.
call
(
p
od
,
[])
end
pods_to_update
=
result
.
podfile_state
.
changed
+
result
.
podfile_state
.
deleted
if
update_mode
==
:selected
# If selected Pods should been updated, filter them out of the list
pods_to_update
+=
update
[
:pods
]
end
pods_to_update
+=
update
[
:pods
]
if
update_mode
==
:selected
pods_to_update
.
each
{
|
u
|
dependency_graph
.
detach_vertex_named
(
u
)
}
end
dependency_graph
end
...
...
lib/cocoapods/resolver.rb
View file @
edc4f9f7
...
...
@@ -67,10 +67,11 @@ module Pod
@specs_by_target
||=
begin
specs_by_target
=
{}
podfile
.
target_definition_list
.
each
do
|
target
|
specs
_by_target
[
target
]
=
target
.
dependencies
.
map
(
&
:name
).
map
do
|
name
|
specs
=
target
.
dependencies
.
map
(
&
:name
).
map
do
|
name
|
node
=
@activated
.
vertex_named
(
name
)
(
node
.
recursive_successors
<<
node
).
to_a
end
.
end
specs_by_target
[
target
]
=
specs
.
flatten
.
map
(
&
:payload
).
uniq
.
...
...
@@ -95,11 +96,18 @@ module Pod
def
search_for
(
dependency
)
@search
||=
{}
@search
[
dependency
]
||=
begin
find_cached_set
(
dependency
).
specs
=
find_cached_set
(
dependency
).
all_specifications
.
select
{
|
s
|
dependency
.
requirement
.
satisfied_by?
s
.
version
}.
map
{
|
s
|
s
.
subspec_by_name
dependency
.
name
rescue
nil
}.
compact
.
map
do
|
s
|
begin
s
.
subspec_by_name
dependency
.
name
rescue
nil
end
end
.
compact
specs
.
reverse
.
each
{
|
s
|
s
.
version
.
head
=
dependency
.
head?
}
end
...
...
@@ -214,7 +222,7 @@ module Pod
end
cached_sets
[
name
]
=
set
unless
set
raise
Molinillo
::
NoSuchDependencyError
.
new
(
dependency
)
raise
Molinillo
::
NoSuchDependencyError
.
new
(
dependency
)
# rubocop:disable Style/RaiseArgs
end
end
cached_sets
[
name
]
...
...
lib/cocoapods/resolver/lazy_specification.rb
View file @
edc4f9f7
...
...
@@ -35,10 +35,15 @@ module Pod
def
all_specifications
@all_specifications
||=
begin
versions_by_source
.
reduce
({})
do
|
sources_by_version
,
(
source
,
versions
)
|
sources_by_version
=
{}
versions_by_source
.
each
do
|
source
,
versions
|
versions
.
each
{
|
v
|
(
sources_by_version
[
v
]
||=
[])
<<
source
}
sources_by_version
end
.
select
{
|
_version
,
sources
|
sources
.
count
>
1
}.
each
do
|
version
,
sources
|
end
duplicate_versions
=
sources_by_version
.
select
{
|
_version
,
sources
|
sources
.
count
>
1
}
duplicate_versions
.
each
do
|
version
,
sources
|
UI
.
warn
"Found multiple specifications for `
#{
name
}
(
#{
version
}
)`:
\n
"
+
sources
.
map
{
|
s
|
s
.
specification_path
(
name
,
version
)
}.
...
...
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