Class: Pod::Downloader::Cache

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-multithread-installpod.rb

Overview

The class responsible for managing Pod downloads, transparently caching them in a cache directory.

Constant Summary collapse

@@mutex =
Mutex.new

Instance Method Summary collapse

Instance Method Details

#ensure_matching_versionObject



52
53
54
55
56
57
58
59
60
61
# File 'lib/cocoapods-multithread-installpod.rb', line 52

def ensure_matching_version
  @@mutex.lock
  version_file = root + 'VERSION'
  version = version_file.read.strip if version_file.file?

  root.rmtree if version != Pod::VERSION && root.exist?
  root.mkpath
  version_file.open('w') { |f| f << Pod::VERSION }
  @@mutex.unlock
end