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
...@@ -16,6 +16,10 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides ...@@ -16,6 +16,10 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
[Kyle Fuller](https://github.com/kylef) [Kyle Fuller](https://github.com/kylef)
[#2025](https://github.com/CocoaPods/CocoaPods/issues/2025) [#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 ##### Bug Fixes
* Fixed support for file references in the workspace generated by CocoaPods. * Fixed support for file references in the workspace generated by CocoaPods.
......
...@@ -164,9 +164,10 @@ module Pod ...@@ -164,9 +164,10 @@ module Pod
# #
def analyze def analyze
if lockfile && lockfile.cocoapods_version > Version.new(VERSION) if lockfile && lockfile.cocoapods_version > Version.new(VERSION)
STDERR.puts '[!] The version of CocoaPods used to generate the lockfile is '\ STDERR.puts '[!] The version of CocoaPods used to generate ' \
'higher than the version of the current executable. Incompatibility ' \ "the lockfile (#{lockfile.cocoapods_version}) is "\
'issues may arise.'.yellow "higher than the version of the current executable (#{VERSION}). " \
'Incompatibility issues may arise.'.yellow
end end
analyzer = Analyzer.new(sandbox, podfile, lockfile) analyzer = Analyzer.new(sandbox, podfile, lockfile)
......
...@@ -206,7 +206,7 @@ module Pod ...@@ -206,7 +206,7 @@ module Pod
min, max = versions['min'], versions['max'] min, max = versions['min'], versions['max']
version_msg = ( min == max ) ? min : "#{min} - #{max}" version_msg = ( min == max ) ? min : "#{min} - #{max}"
raise Informative, "The `#{dir.basename}` repo requires " \ 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." "Update CocoaPods, or checkout the appropriate tag in the repo."
end end
......
...@@ -153,9 +153,11 @@ module Pod ...@@ -153,9 +153,11 @@ module Pod
SourcesManager.stubs(:version_information).returns({ 'min' => '999.0' }) SourcesManager.stubs(:version_information).returns({ 'min' => '999.0' })
e = lambda { SourcesManager.check_version_information(temporary_directory) }.should.raise Informative e = lambda { SourcesManager.check_version_information(temporary_directory) }.should.raise Informative
e.message.should.match /Update CocoaPods/ e.message.should.match /Update CocoaPods/
e.message.should.match /(currently using #{Pod::VERSION})/
SourcesManager.stubs(:version_information).returns({ 'max' => '0.0.1' }) SourcesManager.stubs(:version_information).returns({ 'max' => '0.0.1' })
e = lambda { SourcesManager.check_version_information(temporary_directory) }.should.raise Informative e = lambda { SourcesManager.check_version_information(temporary_directory) }.should.raise Informative
e.message.should.match /Update CocoaPods/ e.message.should.match /Update CocoaPods/
e.message.should.match /(currently using #{Pod::VERSION})/
end end
it 'raises when reading version information with merge conflict' do 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