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
fd8ac57e
Commit
fd8ac57e
authored
Apr 09, 2013
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Installer] Warn if the Lockfile was generated with a higher version of CP
Closes #874
parent
b81c03c4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
installer.rb
lib/cocoapods/installer.rb
+10
-0
installer_spec.rb
spec/unit/installer_spec.rb
+6
-0
No files found.
lib/cocoapods/installer.rb
View file @
fd8ac57e
...
@@ -151,7 +151,17 @@ module Pod
...
@@ -151,7 +151,17 @@ module Pod
# @return [void]
# @return [void]
#
#
# @note The warning about the version of the Lockfile doesn't uses the
# `UI.warn` method because it prints the output only at the end
# of the installation. At that time CocoaPods could have crashed.
#
def
analyze
def
analyze
if
lockfile
&&
lockfile
.
cocoapods_version
>
Version
.
new
(
VERSION
)
STDERR
.
puts
'[!] The version of CocoaPods used to generate the lockfile is '
\
'higher that the one of the current executable. Incompatibility'
\
'issues might arise.'
.
yellow
end
analyzer
=
Analyzer
.
new
(
sandbox
,
podfile
,
lockfile
)
analyzer
=
Analyzer
.
new
(
sandbox
,
podfile
,
lockfile
)
analyzer
.
update_mode
=
update_mode
analyzer
.
update_mode
=
update_mode
@analysis_result
=
analyzer
.
analyze
@analysis_result
=
analyzer
.
analyze
...
...
spec/unit/installer_spec.rb
View file @
fd8ac57e
...
@@ -93,6 +93,12 @@ module Pod
...
@@ -93,6 +93,12 @@ module Pod
describe
"#analyze"
do
describe
"#analyze"
do
it
"prints a warning if the version of the Lockfile is higher than the one of the executable"
do
Lockfile
.
any_instance
.
stubs
(
:cocoapods_version
).
returns
(
Version
.
new
(
'999'
))
STDERR
.
expects
(
:puts
)
@installer
.
send
(
:analyze
)
end
it
"analyzes the Podfile, the Lockfile and the Sandbox"
do
it
"analyzes the Podfile, the Lockfile and the Sandbox"
do
@installer
.
send
(
:analyze
)
@installer
.
send
(
:analyze
)
@installer
.
analysis_result
.
sandbox_state
.
added
.
should
==
[
"JSONKit"
]
@installer
.
analysis_result
.
sandbox_state
.
added
.
should
==
[
"JSONKit"
]
...
...
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