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
3f214a9b
Commit
3f214a9b
authored
Mar 12, 2016
by
Marius Rackwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Command] Extract Options::RepoUpdate
parent
674f6a7c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
25 deletions
+44
-25
command.rb
lib/cocoapods/command.rb
+1
-0
install.rb
lib/cocoapods/command/install.rb
+4
-6
repo_update.rb
lib/cocoapods/command/options/repo_update.rb
+34
-0
outdated.rb
lib/cocoapods/command/outdated.rb
+2
-12
update.rb
lib/cocoapods/command/update.rb
+3
-7
No files found.
lib/cocoapods/command.rb
View file @
3f214a9b
...
@@ -14,6 +14,7 @@ module Pod
...
@@ -14,6 +14,7 @@ module Pod
end
end
class
Command
<
CLAide
::
Command
class
Command
<
CLAide
::
Command
require
'cocoapods/command/options/repo_update'
require
'cocoapods/command/options/project_directory'
require
'cocoapods/command/options/project_directory'
include
Options
include
Options
...
...
lib/cocoapods/command/install.rb
View file @
3f214a9b
module
Pod
module
Pod
class
Command
class
Command
class
Install
<
Command
class
Install
<
Command
include
RepoUpdate
include
ProjectDirectory
include
ProjectDirectory
self
.
summary
=
'Install project dependencies to Podfile.lock versions'
self
.
summary
=
'Install project dependencies to Podfile.lock versions'
...
@@ -25,15 +26,12 @@ module Pod
...
@@ -25,15 +26,12 @@ module Pod
def
self
.
options
def
self
.
options
[
[
[
'--repo-update'
,
'Force running `pod repo update` before install'
],
[
'--repo-update'
,
'Force running `pod repo update` before install'
],
].
concat
(
super
)
].
concat
(
super
).
reject
{
|
(
name
,
_
)
|
name
==
'--no-repo-update'
}
end
def
initialize
(
argv
)
config
.
skip_repo_update
=
!
argv
.
flag?
(
'repo-update'
,
false
)
super
end
end
def
run
def
run
config
.
skip_repo_update
=
!
repo_update?
(
:default
=>
false
)
verify_podfile_exists!
verify_podfile_exists!
installer
=
installer_for_config
installer
=
installer_for_config
installer
.
update
=
false
installer
.
update
=
false
...
...
lib/cocoapods/command/options/repo_update.rb
0 → 100644
View file @
3f214a9b
module
Pod
class
Command
module
Options
# Provides support for commands to skip updating the spec repositories.
#
module
RepoUpdate
module
Options
def
options
[
[
'--no-repo-update'
,
'Skip running `pod repo update` before install'
],
].
concat
(
super
)
end
end
def
self
.
included
(
base
)
base
.
extend
(
Options
)
end
def
repo_update?
(
default:
false
)
if
@repo_update
.
nil?
default
else
@repo_update
end
end
def
initialize
(
argv
)
@repo_update
=
argv
.
flag?
(
'repo-update'
)
super
end
end
end
end
end
lib/cocoapods/command/outdated.rb
View file @
3f214a9b
module
Pod
module
Pod
class
Command
class
Command
class
Outdated
<
Command
class
Outdated
<
Command
include
RepoUpdate
include
ProjectDirectory
include
ProjectDirectory
self
.
summary
=
'Show outdated project dependencies'
self
.
summary
=
'Show outdated project dependencies'
...
@@ -10,17 +11,6 @@ module Pod
...
@@ -10,17 +11,6 @@ module Pod
spec repos, not those from local/external sources or `:head` versions.
spec repos, not those from local/external sources or `:head` versions.
DESC
DESC
def
self
.
options
[
[
'--no-repo-update'
,
'Skip running `pod repo update` before install'
],
].
concat
(
super
)
end
def
initialize
(
argv
)
config
.
skip_repo_update
=
!
argv
.
flag?
(
'repo-update'
,
!
config
.
skip_repo_update
)
super
end
# Run the command
# Run the command
#
#
# @todo the command report new dependencies added to the Podfile as
# @todo the command report new dependencies added to the Podfile as
...
@@ -103,7 +93,7 @@ module Pod
...
@@ -103,7 +93,7 @@ module Pod
def
spec_sets
def
spec_sets
@spec_sets
||=
begin
@spec_sets
||=
begin
analyzer
.
send
(
:update_repositories
)
unless
config
.
skip_repo_update?
analyzer
.
send
(
:update_repositories
)
if
repo_update?
(
:default
=>
true
)
aggregate
=
Source
::
Aggregate
.
new
(
analyzer
.
sources
)
aggregate
=
Source
::
Aggregate
.
new
(
analyzer
.
sources
)
installed_pods
.
map
do
|
pod_name
|
installed_pods
.
map
do
|
pod_name
|
aggregate
.
search
(
Dependency
.
new
(
pod_name
))
aggregate
.
search
(
Dependency
.
new
(
pod_name
))
...
...
lib/cocoapods/command/update.rb
View file @
3f214a9b
module
Pod
module
Pod
class
Command
class
Command
class
Update
<
Command
class
Update
<
Command
include
RepoUpdate
include
ProjectDirectory
include
ProjectDirectory
self
.
summary
=
'Update outdated project dependencies and create new '
\
self
.
summary
=
'Update outdated project dependencies and create new '
\
...
@@ -18,14 +19,7 @@ module Pod
...
@@ -18,14 +19,7 @@ module Pod
CLAide
::
Argument
.
new
(
'POD_NAMES'
,
false
,
true
),
CLAide
::
Argument
.
new
(
'POD_NAMES'
,
false
,
true
),
]
]
def
self
.
options
[
[
'--no-repo-update'
,
'Skip running `pod repo update` before install'
],
].
concat
(
super
)
end
def
initialize
(
argv
)
def
initialize
(
argv
)
config
.
skip_repo_update
=
!
argv
.
flag?
(
'repo-update'
,
!
config
.
skip_repo_update
)
@pods
=
argv
.
arguments!
unless
argv
.
arguments
.
empty?
@pods
=
argv
.
arguments!
unless
argv
.
arguments
.
empty?
super
super
end
end
...
@@ -51,6 +45,8 @@ module Pod
...
@@ -51,6 +45,8 @@ module Pod
end
end
def
run
def
run
config
.
skip_repo_update
=
!
repo_update?
(
:default
=>
true
)
verify_podfile_exists!
verify_podfile_exists!
installer
=
installer_for_config
installer
=
installer_for_config
...
...
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