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
4345124a
Commit
4345124a
authored
Mar 09, 2016
by
Marius Rackwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Command::Project] No repo update by default on install
parent
917dcf2d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
26 deletions
+57
-26
outdated.rb
lib/cocoapods/command/outdated.rb
+11
-0
project.rb
lib/cocoapods/command/project.rb
+18
-17
project_spec.rb
spec/functional/command/project_spec.rb
+28
-9
No files found.
lib/cocoapods/command/outdated.rb
View file @
4345124a
...
@@ -8,6 +8,17 @@ module Pod
...
@@ -8,6 +8,17 @@ 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
...
...
lib/cocoapods/command/project.rb
View file @
4345124a
...
@@ -36,23 +36,6 @@ module Pod
...
@@ -36,23 +36,6 @@ module Pod
# commands.
# commands.
#
#
module
Project
module
Project
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
initialize
(
argv
)
config
.
skip_repo_update
=
!
argv
.
flag?
(
'repo-update'
,
!
config
.
skip_repo_update
)
super
end
# Runs the installer.
# Runs the installer.
#
#
# @param [Hash, Boolean, nil] update
# @param [Hash, Boolean, nil] update
...
@@ -92,6 +75,17 @@ module Pod
...
@@ -92,6 +75,17 @@ module Pod
Pod resources.
Pod resources.
DESC
DESC
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
end
def
run
def
run
verify_podfile_exists!
verify_podfile_exists!
run_install_with_update
(
false
)
run_install_with_update
(
false
)
...
@@ -118,7 +112,14 @@ module Pod
...
@@ -118,7 +112,14 @@ 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
...
...
spec/functional/command/project_spec.rb
View file @
4345124a
require
File
.
expand_path
(
'../../../spec_helper'
,
__FILE__
)
require
File
.
expand_path
(
'../../../spec_helper'
,
__FILE__
)
module
Pod
module
Pod
describe
Command
::
Project
do
it
'tells the user that no Podfile or podspec was found in the current working dir'
do
Command
::
Install
.
new
(
CLAide
::
ARGV
.
new
([
'--no-repo-update'
]))
config
.
skip_repo_update
.
should
.
be
.
true
end
end
#---------------------------------------------------------------------------#
describe
Command
::
Install
do
describe
Command
::
Install
do
it
'tells the user that no Podfile or podspec was found in the project dir'
do
it
'tells the user that no Podfile or podspec was found in the project dir'
do
exception
=
lambda
{
run_command
(
'install'
,
'--no-repo-update'
)
}.
should
.
raise
Informative
exception
=
lambda
{
run_command
(
'install'
,
'--no-repo-update'
)
}.
should
.
raise
Informative
exception
.
message
.
should
.
include
"No `Podfile' found in the project directory."
exception
.
message
.
should
.
include
"No `Podfile' found in the project directory."
end
end
it
"doesn't update the spec repos by default"
do
config
.
with_changes
(
:skip_repo_update
=>
nil
)
do
Pod
::
Command
.
parse
([
'install'
])
config
.
skip_repo_update
.
should
.
be
.
true
end
end
it
'updates the spec repos if that option was given'
do
config
.
with_changes
(
:skip_repo_update
=>
nil
)
do
Pod
::
Command
.
parse
([
'install'
,
'--repo-update'
])
config
.
skip_repo_update
.
should
.
be
.
false
end
end
end
end
#---------------------------------------------------------------------------#
#---------------------------------------------------------------------------#
...
@@ -27,6 +32,20 @@ module Pod
...
@@ -27,6 +32,20 @@ module Pod
exception
.
message
.
should
.
include
"No `Podfile' found in the project directory."
exception
.
message
.
should
.
include
"No `Podfile' found in the project directory."
end
end
it
'updates the spec repos by default'
do
config
.
with_changes
(
:skip_repo_update
=>
nil
)
do
Pod
::
Command
.
parse
([
'update'
])
config
.
skip_repo_update
.
should
.
be
.
false
end
end
it
"doesn't update the spec repos if that option was given"
do
config
.
with_changes
(
:skip_repo_update
=>
nil
)
do
Pod
::
Command
.
parse
([
'update'
,
'--no-repo-update'
])
config
.
skip_repo_update
.
should
.
be
.
true
end
end
it
'tells the user that no Lockfile was found in the project dir'
do
it
'tells the user that no Lockfile was found in the project dir'
do
file
=
temporary_directory
+
'Podfile'
file
=
temporary_directory
+
'Podfile'
File
.
open
(
file
,
'w'
)
do
|
f
|
File
.
open
(
file
,
'w'
)
do
|
f
|
...
...
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