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
end
class
Command
<
CLAide
::
Command
require
'cocoapods/command/options/repo_update'
require
'cocoapods/command/options/project_directory'
include
Options
...
...
lib/cocoapods/command/install.rb
View file @
3f214a9b
module
Pod
class
Command
class
Install
<
Command
include
RepoUpdate
include
ProjectDirectory
self
.
summary
=
'Install project dependencies to Podfile.lock versions'
...
...
@@ -25,15 +26,12 @@ module Pod
def
self
.
options
[
[
'--repo-update'
,
'Force running `pod repo update` before install'
],
].
concat
(
super
)
end
def
initialize
(
argv
)
config
.
skip_repo_update
=
!
argv
.
flag?
(
'repo-update'
,
false
)
super
].
concat
(
super
).
reject
{
|
(
name
,
_
)
|
name
==
'--no-repo-update'
}
end
def
run
config
.
skip_repo_update
=
!
repo_update?
(
:default
=>
false
)
verify_podfile_exists!
installer
=
installer_for_config
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
class
Command
class
Outdated
<
Command
include
RepoUpdate
include
ProjectDirectory
self
.
summary
=
'Show outdated project dependencies'
...
...
@@ -10,17 +11,6 @@ module Pod
spec repos, not those from local/external sources or `:head` versions.
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
#
# @todo the command report new dependencies added to the Podfile as
...
...
@@ -103,7 +93,7 @@ module Pod
def
spec_sets
@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
)
installed_pods
.
map
do
|
pod_name
|
aggregate
.
search
(
Dependency
.
new
(
pod_name
))
...
...
lib/cocoapods/command/update.rb
View file @
3f214a9b
module
Pod
class
Command
class
Update
<
Command
include
RepoUpdate
include
ProjectDirectory
self
.
summary
=
'Update outdated project dependencies and create new '
\
...
...
@@ -18,14 +19,7 @@ module Pod
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
)
config
.
skip_repo_update
=
!
argv
.
flag?
(
'repo-update'
,
!
config
.
skip_repo_update
)
@pods
=
argv
.
arguments!
unless
argv
.
arguments
.
empty?
super
end
...
...
@@ -51,6 +45,8 @@ module Pod
end
def
run
config
.
skip_repo_update
=
!
repo_update?
(
:default
=>
true
)
verify_podfile_exists!
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