Class: CarthageCache::Project

Inherits:
Object
  • Object
show all
Defined in:
lib/carthage_cache/project.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project_path, cache_dir_name, terminal, tmpdir, swift_version_resolver = SwiftVersionResolver.new) ⇒ Project

Returns a new instance of Project.



11
12
13
14
15
16
17
# File 'lib/carthage_cache/project.rb', line 11

def initialize(project_path, cache_dir_name, terminal, tmpdir, swift_version_resolver = SwiftVersionResolver.new)
  @project_path = project_path
  @cache_dir_name = cache_dir_name
  @terminal = terminal
  @tmpdir_base_path = tmpdir
  @cartfile = CartfileResolvedFile.new(cartfile_resolved_path, swift_version_resolver)
end

Instance Attribute Details

#cache_dir_nameObject (readonly)

Returns the value of attribute cache_dir_name.



7
8
9
# File 'lib/carthage_cache/project.rb', line 7

def cache_dir_name
  @cache_dir_name
end

#cartfileObject (readonly)

Returns the value of attribute cartfile.



5
6
7
# File 'lib/carthage_cache/project.rb', line 5

def cartfile
  @cartfile
end

#project_pathObject (readonly)

Returns the value of attribute project_path.



6
7
8
# File 'lib/carthage_cache/project.rb', line 6

def project_path
  @project_path
end

#terminalObject (readonly)

Returns the value of attribute terminal.



8
9
10
# File 'lib/carthage_cache/project.rb', line 8

def terminal
  @terminal
end

#tmpdir_base_pathObject (readonly)

Returns the value of attribute tmpdir_base_path.



9
10
11
# File 'lib/carthage_cache/project.rb', line 9

def tmpdir_base_path
  @tmpdir_base_path
end

Instance Method Details

#archive_filenameObject



19
20
21
# File 'lib/carthage_cache/project.rb', line 19

def archive_filename
  @archive_filename ||= "#{archive_key}.zip"
end

#archive_keyObject



23
24
25
# File 'lib/carthage_cache/project.rb', line 23

def archive_key
  cartfile.digest
end

#carthage_build_directoryObject



31
32
33
# File 'lib/carthage_cache/project.rb', line 31

def carthage_build_directory
  @carthage_build_directory ||= File.join(project_path, "Carthage", "Build")
end

#tmpdirObject



27
28
29
# File 'lib/carthage_cache/project.rb', line 27

def tmpdir
  @tmpdir ||= create_tmpdir
end