Class: CarthageCache::Archiver

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

Instance Method Summary collapse

Instance Method Details

#archive(archive_path, destination_path) ⇒ Object



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

def archive(archive_path, destination_path)
  files = Dir.entries(archive_path).select { |x| !x.start_with?(".") }
  `cd #{archive_path} && zip -r -X #{File.expand_path(destination_path)} #{files.join(' ')} > /dev/null`
end

#unarchive(archive_path, destination_path) ⇒ Object



10
11
12
# File 'lib/carthage_cache/archiver.rb', line 10

def unarchive(archive_path, destination_path)
  `unzip #{archive_path} -d #{destination_path} > /dev/null`
end