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
16392d46
Commit
16392d46
authored
Mar 12, 2016
by
Marius Rackwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose Installer#repo_update instead Config#skip_repo_update
parent
99d2ecf6
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
41 additions
and
44 deletions
+41
-44
install.rb
lib/cocoapods/command/install.rb
+1
-2
update.rb
lib/cocoapods/command/update.rb
+1
-2
config.rb
lib/cocoapods/config.rb
+0
-6
installer.rb
lib/cocoapods/installer.rb
+6
-1
validator.rb
lib/cocoapods/validator.rb
+0
-1
install_spec.rb
spec/functional/command/install_spec.rb
+14
-7
outdated_spec.rb
spec/functional/command/outdated_spec.rb
+0
-4
update_spec.rb
spec/functional/command/update_spec.rb
+16
-14
pre_flight.rb
spec/spec_helper/pre_flight.rb
+0
-1
installer_spec.rb
spec/unit/installer_spec.rb
+3
-6
No files found.
lib/cocoapods/command/install.rb
View file @
16392d46
...
...
@@ -30,10 +30,9 @@ module Pod
end
def
run
config
.
skip_repo_update
=
!
repo_update?
(
:default
=>
false
)
verify_podfile_exists!
installer
=
installer_for_config
installer
.
repo_update
=
repo_update?
(
:default
=>
false
)
installer
.
update
=
false
installer
.
install!
end
...
...
lib/cocoapods/command/update.rb
View file @
16392d46
...
...
@@ -45,11 +45,10 @@ module Pod
end
def
run
config
.
skip_repo_update
=
!
repo_update?
(
:default
=>
true
)
verify_podfile_exists!
installer
=
installer_for_config
installer
.
repo_update
=
repo_update?
(
:default
=>
true
)
if
@pods
verify_lockfile_exists!
verify_pods_are_installed!
...
...
lib/cocoapods/config.rb
View file @
16392d46
...
...
@@ -14,7 +14,6 @@ module Pod
DEFAULTS
=
{
:verbose
=>
false
,
:silent
=>
false
,
:skip_repo_update
=>
false
,
:skip_download_cache
=>
!
ENV
[
'COCOAPODS_SKIP_CACHE'
].
nil?
,
:new_version_message
=>
ENV
[
'COCOAPODS_SKIP_UPDATE_MESSAGE'
].
nil?
,
...
...
@@ -69,11 +68,6 @@ module Pod
# @!group Installation
# @return [Bool] Whether the installer should skip the repos update.
#
attr_accessor
:skip_repo_update
alias_method
:skip_repo_update?
,
:skip_repo_update
# @return [Bool] Whether the installer should skip the download cache.
#
attr_accessor
:skip_download_cache
...
...
lib/cocoapods/installer.rb
View file @
16392d46
...
...
@@ -84,6 +84,11 @@ module Pod
#
attr_accessor
:update
# @return [Bool] Whether the spec repos should be updated.
#
attr_accessor
:repo_update
alias_method
:repo_update?
,
:repo_update
# @return [Boolean] Whether default plugins should be used during
# installation. Defaults to true.
#
...
...
@@ -140,7 +145,7 @@ module Pod
UI
.
section
'Updating local specs repositories'
do
analyzer
.
update_repositories
end
unless
config
.
skip_
repo_update?
end
if
repo_update?
UI
.
section
'Analyzing dependencies'
do
analyze
(
analyzer
)
...
...
lib/cocoapods/validator.rb
View file @
16392d46
...
...
@@ -349,7 +349,6 @@ module Pod
@original_config
=
Config
.
instance
.
clone
config
.
installation_root
=
validation_dir
config
.
silent
=
!
config
.
verbose
config
.
skip_repo_update
=
true
end
def
tear_down_validation_environment
...
...
spec/functional/command/install_spec.rb
View file @
16392d46
...
...
@@ -7,17 +7,24 @@ module Pod
exception
.
message
.
should
.
include
"No `Podfile' found in the project directory."
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
describe
'updates of the spec repos'
do
before
do
file
=
temporary_directory
+
'Podfile'
File
.
open
(
file
,
'w'
)
do
|
f
|
f
.
puts
(
'platform :ios'
)
f
.
puts
(
'pod "Reachability"'
)
end
Installer
.
any_instance
.
expects
(
:install!
)
end
it
"doesn't update the spec repos by default"
do
Installer
.
any_instance
.
expects
(
:repo_update
=
).
with
(
false
)
run_command
(
'install'
)
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
Installer
.
any_instance
.
expects
(
:repo_update
=
).
with
(
true
)
run_command
(
'install'
,
'--repo-update'
)
end
end
end
...
...
spec/functional/command/outdated_spec.rb
View file @
16392d46
...
...
@@ -6,7 +6,6 @@ module Pod
before
do
Command
::
Outdated
.
any_instance
.
stubs
(
:unlocked_pods
).
returns
([])
config
.
stubs
(
:skip_repo_update?
).
returns
(
true
)
end
it
'tells the user that no Podfile was found in the project dir'
do
...
...
@@ -55,7 +54,6 @@ module Pod
pod
'AFNetworking'
end
config
.
stubs
(
:podfile
).
returns
(
podfile
)
config
.
stubs
(
:skip_repo_update?
).
returns
(
false
)
lockfile
=
mock
lockfile
.
stubs
(
:version
).
returns
(
Version
.
new
(
'1.0'
))
lockfile
.
stubs
(
:pod_names
).
returns
(
%w(AFNetworking)
)
...
...
@@ -69,8 +67,6 @@ module Pod
source
'https://github.com/CocoaPods/Specs.git'
pod
'AFNetworking'
end
config
.
unstub
(
:skip_repo_update?
)
config
.
skip_repo_update
=
false
lockfile
=
mock
lockfile
.
stubs
(
:version
).
returns
(
Version
.
new
(
'1.0'
))
lockfile
.
stubs
(
:pod_names
).
returns
(
%w(AFNetworking)
)
...
...
spec/functional/command/update_spec.rb
View file @
16392d46
...
...
@@ -7,20 +7,6 @@ module Pod
exception
.
message
.
should
.
include
"No `Podfile' found in the project directory."
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
describe
'with Podfile'
do
extend
SpecHelper
::
TemporaryRepos
...
...
@@ -32,6 +18,22 @@ module Pod
end
end
describe
'updates of the spec repos'
do
before
do
Installer
.
any_instance
.
expects
(
:install!
)
end
it
'updates the spec repos by default'
do
Installer
.
any_instance
.
expects
(
:repo_update
=
).
with
(
true
)
run_command
(
'update'
)
end
it
"doesn't update the spec repos if that option was given"
do
Installer
.
any_instance
.
expects
(
:repo_update
=
).
with
(
false
)
run_command
(
'update'
,
'--no-repo-update'
)
end
end
it
'tells the user that no Lockfile was found in the project dir'
do
exception
=
lambda
{
run_command
(
'update'
,
'BananaLib'
,
'--no-repo-update'
)
}.
should
.
raise
Informative
exception
.
message
.
should
.
include
"No `Podfile.lock' found in the project directory"
...
...
spec/spec_helper/pre_flight.rb
View file @
16392d46
...
...
@@ -11,7 +11,6 @@ module Bacon
c
.
silent
=
true
c
.
repos_dir
=
fixture
(
'spec-repos'
)
c
.
installation_root
=
SpecHelper
.
temporary_directory
c
.
skip_repo_update
=
true
c
.
cache_root
=
SpecHelper
.
temporary_directory
+
'Cache'
end
...
...
spec/unit/installer_spec.rb
View file @
16392d46
...
...
@@ -105,7 +105,6 @@ module Pod
end
it
'runs source provider hooks before analyzing'
do
config
.
skip_repo_update
=
true
@installer
.
unstub
(
:resolve_dependencies
)
@installer
.
stubs
(
:validate_build_configurations
)
@installer
.
stubs
(
:clean_sandbox
)
...
...
@@ -136,7 +135,6 @@ module Pod
@installer
.
stubs
(
:clean_sandbox
)
@installer
.
stubs
(
:ensure_plugins_are_installed!
)
@installer
.
stubs
(
:analyze
)
config
.
skip_repo_update
=
true
analyzer
=
Installer
::
Analyzer
.
new
(
config
.
sandbox
,
@installer
.
podfile
,
@installer
.
lockfile
)
analyzer
.
stubs
(
:analyze
)
...
...
@@ -376,14 +374,13 @@ module Pod
describe
'Dependencies Resolution'
do
describe
'updating spec repos'
do
it
'does not updates the repositories if config indicates to skip them'
do
config
.
skip_repo_update
=
true
it
'does not updates the repositories by default'
do
SourcesManager
.
expects
(
:update
).
never
@installer
.
send
(
:resolve_dependencies
)
end
it
'updates the repositories
by default
'
do
config
.
skip_repo_update
=
fals
e
it
'updates the repositories
if that was requested
'
do
@installer
.
repo_update
=
tru
e
SourcesManager
.
expects
(
:update
).
once
@installer
.
send
(
:resolve_dependencies
)
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