195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
|
# File 'lib/cocoapods/sources_manager.rb', line 195
def verify_compatibility!
super
latest_cocoapods_version = metadata.latest_cocoapods_version && Gem::Version.create(metadata.latest_cocoapods_version)
return unless Config.instance.new_version_message? &&
latest_cocoapods_version &&
latest_cocoapods_version > Gem::Version.new(Pod::VERSION)
rc = latest_cocoapods_version.prerelease?
install_message = !Pathname(__FILE__).dirname.writable? ? 'sudo ' : ''
install_message << 'gem install cocoapods'
install_message << ' --pre' if rc
message = [
'',
"CocoaPods #{latest_cocoapods_version} is available.".green,
"To update use: `#{install_message}`".green,
("[!] This is a test version we'd love you to try.".yellow if rc),
'',
'For more information, see https://blog.cocoapods.org ' \
'and the CHANGELOG for this version at ' \
"https://github.com/CocoaPods/CocoaPods/releases/tag/#{latest_cocoapods_version}".green,
'',
'',
].compact.join("\n")
UI.puts(message)
end
|