Class: ET::ArchiveManager

Inherits:
Object
  • Object
show all
Defined in:
lib/et/archive_manager.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(archive, destination) ⇒ ArchiveManager

Returns a new instance of ArchiveManager.



6
7
8
9
# File 'lib/et/archive_manager.rb', line 6

def initialize(archive, destination)
  @archive = archive
  @destination = destination
end

Instance Attribute Details

#archiveObject (readonly)

Returns the value of attribute archive.



4
5
6
# File 'lib/et/archive_manager.rb', line 4

def archive
  @archive
end

#destinationObject (readonly)

Returns the value of attribute destination.



4
5
6
# File 'lib/et/archive_manager.rb', line 4

def destination
  @destination
end

#unpacked_filesObject (readonly)

Returns the value of attribute unpacked_files.



4
5
6
# File 'lib/et/archive_manager.rb', line 4

def unpacked_files
  @unpacked_files
end

Instance Method Details

#delete_archiveObject



11
12
13
# File 'lib/et/archive_manager.rb', line 11

def delete_archive
  File.delete(archive)
end

#unpackObject



15
16
17
18
19
20
21
# File 'lib/et/archive_manager.rb', line 15

def unpack
  @unpacked_files = []
  File.open(archive, "rb") do |tar_gz|
    uncompress(tar_gz)
  end
  @unpacked_files
end