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
b31abc36
Commit
b31abc36
authored
Mar 12, 2016
by
Marius Rackwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Command] Add Command#installer_for_config
Use that instead of Project#run_install_with_update
parent
4345124a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
27 deletions
+15
-27
command.rb
lib/cocoapods/command.rb
+8
-1
project.rb
lib/cocoapods/command/project.rb
+7
-26
No files found.
lib/cocoapods/command.rb
View file @
b31abc36
...
@@ -33,7 +33,6 @@ module Pod
...
@@ -33,7 +33,6 @@ module Pod
self
.
plugin_prefixes
=
%w(claide cocoapods)
self
.
plugin_prefixes
=
%w(claide cocoapods)
[
Install
,
Update
,
Outdated
,
IPC
::
Podfile
,
IPC
::
Repl
].
each
{
|
c
|
c
.
send
(
:include
,
ProjectDirectory
)
}
[
Install
,
Update
,
Outdated
,
IPC
::
Podfile
,
IPC
::
Repl
].
each
{
|
c
|
c
.
send
(
:include
,
ProjectDirectory
)
}
[
Outdated
].
each
{
|
c
|
c
.
send
(
:include
,
Project
)
}
def
self
.
options
def
self
.
options
[
[
...
@@ -102,6 +101,14 @@ module Pod
...
@@ -102,6 +101,14 @@ module Pod
private
private
# Returns a new {Installer} parametrized from the {Config}.
#
# @return [Installer]
#
def
installer_for_config
Installer
.
new
(
config
.
sandbox
,
config
.
podfile
,
config
.
lockfile
)
end
# Checks that the podfile exists.
# Checks that the podfile exists.
#
#
# @raise If the podfile does not exists.
# @raise If the podfile does not exists.
...
...
lib/cocoapods/command/project.rb
View file @
b31abc36
...
@@ -32,30 +32,9 @@ module Pod
...
@@ -32,30 +32,9 @@ module Pod
end
end
end
end
# Provides support for the common behaviour of the `install` and `update`
# commands.
#
module
Project
# Runs the installer.
#
# @param [Hash, Boolean, nil] update
# Pods that have been requested to be updated or true if all Pods
# should be updated
#
# @return [void]
#
def
run_install_with_update
(
update
)
installer
=
Installer
.
new
(
config
.
sandbox
,
config
.
podfile
,
config
.
lockfile
)
installer
.
update
=
update
installer
.
install!
end
end
#-------------------------------------------------------------------------#
#-------------------------------------------------------------------------#
class
Install
<
Command
class
Install
<
Command
include
Project
self
.
summary
=
'Install project dependencies to Podfile.lock versions'
self
.
summary
=
'Install project dependencies to Podfile.lock versions'
self
.
description
=
<<-
DESC
self
.
description
=
<<-
DESC
...
@@ -88,15 +67,15 @@ module Pod
...
@@ -88,15 +67,15 @@ module Pod
def
run
def
run
verify_podfile_exists!
verify_podfile_exists!
run_install_with_update
(
false
)
installer
=
installer_for_config
installer
.
update
=
false
installer
.
install!
end
end
end
end
#-------------------------------------------------------------------------#
#-------------------------------------------------------------------------#
class
Update
<
Command
class
Update
<
Command
include
Project
self
.
summary
=
'Update outdated project dependencies and create new '
\
self
.
summary
=
'Update outdated project dependencies and create new '
\
'Podfile.lock'
'Podfile.lock'
...
@@ -127,6 +106,7 @@ module Pod
...
@@ -127,6 +106,7 @@ module Pod
def
run
def
run
verify_podfile_exists!
verify_podfile_exists!
installer
=
installer_for_config
if
@pods
if
@pods
verify_lockfile_exists!
verify_lockfile_exists!
...
@@ -147,11 +127,12 @@ module Pod
...
@@ -147,11 +127,12 @@ module Pod
raise
Informative
,
message
raise
Informative
,
message
end
end
run_install_with_update
(
:pods
=>
@pods
)
installer
.
update
=
{
:pods
=>
@pods
}
else
else
UI
.
puts
'Update all pods'
.
yellow
unless
@pods
UI
.
puts
'Update all pods'
.
yellow
unless
@pods
run_install_with_update
(
true
)
installer
.
update
=
true
end
end
installer
.
install!
end
end
end
end
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