Class: Pod::TrunkSource

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods/sources_manager.rb

Updating Sources collapse

Instance Method Details

#verify_compatibility!Object


177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# File 'lib/cocoapods/sources_manager.rb', line 177

def verify_compatibility!
  super
  latest_cocoapods_version = .latest_cocoapods_version && Gem::Version.create(.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