Commit 8faf562b authored by Samuel E. Giddins's avatar Samuel E. Giddins

Print current version when the repo/lockfile requires a higher version

Closes https://github.com/CocoaPods/CocoaPods/issues/2049
parent 72e592d4
......@@ -15,6 +15,10 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
docset_url in podspecs we while linting a specification.
[Kyle Fuller](https://github.com/kylef)
[#2025](https://github.com/CocoaPods/CocoaPods/issues/2025)
* Print current version when the repo/lockfile requires a higher version
[Samuel E. Giddins](https://github.com/segiddins)
[#2049](https://github.com/CocoaPods/CocoaPods/issues/2049)
##### Bug Fixes
......
......@@ -164,9 +164,10 @@ module Pod
#
def analyze
if lockfile && lockfile.cocoapods_version > Version.new(VERSION)
STDERR.puts '[!] The version of CocoaPods used to generate the lockfile is '\
'higher than the version of the current executable. Incompatibility ' \
'issues may arise.'.yellow
STDERR.puts '[!] The version of CocoaPods used to generate ' \
"the lockfile (#{lockfile.cocoapods_version}) is "\
"higher than the version of the current executable (#{VERSION}). " \
'Incompatibility issues may arise.'.yellow
end
analyzer = Analyzer.new(sandbox, podfile, lockfile)
......
......@@ -206,7 +206,7 @@ module Pod
min, max = versions['min'], versions['max']
version_msg = ( min == max ) ? min : "#{min} - #{max}"
raise Informative, "The `#{dir.basename}` repo requires " \
"CocoaPods #{version_msg}\n".red +
"CocoaPods #{version_msg} (currently using #{Pod::VERSION})\n".red +
"Update CocoaPods, or checkout the appropriate tag in the repo."
end
......
......@@ -153,9 +153,11 @@ module Pod
SourcesManager.stubs(:version_information).returns({ 'min' => '999.0' })
e = lambda { SourcesManager.check_version_information(temporary_directory) }.should.raise Informative
e.message.should.match /Update CocoaPods/
e.message.should.match /(currently using #{Pod::VERSION})/
SourcesManager.stubs(:version_information).returns({ 'max' => '0.0.1' })
e = lambda { SourcesManager.check_version_information(temporary_directory) }.should.raise Informative
e.message.should.match /Update CocoaPods/
e.message.should.match /(currently using #{Pod::VERSION})/
end
it 'raises when reading version information with merge conflict' do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment