class CarthageCacheRes::ArchiveInstaller
Attributes
archiver[R]
project[R]
repository[R]
terminal[R]
Public Class Methods
new(terminal, repository, archiver, project)
click to toggle source
# File lib/carthage_cache_res/archive_installer.rb, line 10 def initialize(terminal, repository, archiver, project) @terminal = terminal @repository = repository @archiver = archiver @project = project end
Public Instance Methods
install()
click to toggle source
# File lib/carthage_cache_res/archive_installer.rb, line 17 def install archive_path = download_archive unarchive(archive_path) end
Private Instance Methods
create_carthage_build_directory()
click to toggle source
# File lib/carthage_cache_res/archive_installer.rb, line 24 def create_carthage_build_directory unless File.exist?(project.carthage_build_directory) terminal.vputs "Creating Carthage build directory '#{project.carthage_build_directory}'." FileUtils.mkdir_p(project.carthage_build_directory) end project.carthage_build_directory end
download_archive()
click to toggle source
# File lib/carthage_cache_res/archive_installer.rb, line 32 def download_archive archive_path = File.join(project.tmpdir, project.archive_filename) if File.exist?(archive_path) terminal.puts "Archive with key '#{archive_path}' already downloaded in local cache." else terminal.puts "Downloading archive with key '#{archive_path}'." repository.download(project.archive_path, archive_path) end archive_path end
unarchive(archive_path)
click to toggle source
# File lib/carthage_cache_res/archive_installer.rb, line 45 def unarchive(archive_path) build_directory = create_carthage_build_directory terminal.puts "Unarchiving '#{archive_path}' into '#{build_directory}'." archiver.unarchive(archive_path, build_directory) end