131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
|
# File 'lib/cocoapods/sources_manager.rb', line 131
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
|