Class: Pod::MasterSource

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

Updating Sources collapse

Instance Method Details

#update_git_repo(show_output = false) ⇒ Object



122
123
124
125
126
127
128
129
# File 'lib/cocoapods/sources_manager.rb', line 122

def update_git_repo(show_output = false)
  if repo.join('.git', 'shallow').file?
    UI.info "Performing a deep fetch of the `#{name}` specs repo to improve future performance" do
      git!(%W(-C #{repo} fetch --unshallow))
    end
  end
  super
end

#verify_compatibility!Object



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 = .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