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
ac04c590
Commit
ac04c590
authored
Mar 31, 2014
by
Marius Rackwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactored checks for update_mode? by allowing different states through symbols with update_mode
parent
6091ea45
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
4 deletions
+21
-4
analyzer.rb
lib/cocoapods/installer/analyzer.rb
+21
-4
No files found.
lib/cocoapods/installer/analyzer.rb
View file @
ac04c590
...
@@ -103,6 +103,19 @@ module Pod
...
@@ -103,6 +103,19 @@ module Pod
!!
update
!!
update
end
end
# @return [Symbol] Whether and how the dependencies in the Podfile
# should be updated.
#
def
update_mode
if
!
update
:none
elsif
update
==
true
:all
elsif
update
[
:pods
]
!=
nil
:selected
end
end
# @return [Bool] Whether the analysis allows pre-downloads and thus
# @return [Bool] Whether the analysis allows pre-downloads and thus
# modifications to the sandbox.
# modifications to the sandbox.
#
#
...
@@ -225,9 +238,11 @@ module Pod
...
@@ -225,9 +238,11 @@ module Pod
# that prevent the resolver to update a Pod.
# that prevent the resolver to update a Pod.
#
#
def
generate_version_locking_dependencies
def
generate_version_locking_dependencies
if
update_mode?
# TODO: Add a case for specific pods
case
update_mode
when
:all
[]
[]
els
e
when
:non
e
result
.
podfile_state
.
unchanged
.
map
do
|
pod
|
result
.
podfile_state
.
unchanged
.
map
do
|
pod
|
lockfile
.
dependency_to_lock_pod_named
(
pod
)
lockfile
.
dependency_to_lock_pod_named
(
pod
)
end
end
...
@@ -258,9 +273,11 @@ module Pod
...
@@ -258,9 +273,11 @@ module Pod
deps_to_fetch
=
[]
deps_to_fetch
=
[]
deps_to_fetch_if_needed
=
[]
deps_to_fetch_if_needed
=
[]
deps_with_external_source
=
podfile
.
dependencies
.
select
{
|
dep
|
dep
.
external_source
}
deps_with_external_source
=
podfile
.
dependencies
.
select
{
|
dep
|
dep
.
external_source
}
if
update_mode?
# TODO: Add a case for specific pods
case
update_mode
when
:all
deps_to_fetch
=
deps_with_external_source
deps_to_fetch
=
deps_with_external_source
els
e
when
:non
e
pods_to_fetch
=
result
.
podfile_state
.
added
+
result
.
podfile_state
.
changed
pods_to_fetch
=
result
.
podfile_state
.
added
+
result
.
podfile_state
.
changed
deps_to_fetch
=
deps_with_external_source
.
select
{
|
dep
|
pods_to_fetch
.
include?
(
dep
.
root_name
)
}
deps_to_fetch
=
deps_with_external_source
.
select
{
|
dep
|
pods_to_fetch
.
include?
(
dep
.
root_name
)
}
deps_to_fetch_if_needed
=
deps_with_external_source
.
select
{
|
dep
|
result
.
podfile_state
.
unchanged
.
include?
(
dep
.
root_name
)
}
deps_to_fetch_if_needed
=
deps_with_external_source
.
select
{
|
dep
|
result
.
podfile_state
.
unchanged
.
include?
(
dep
.
root_name
)
}
...
...
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