Class: ET::ArchiveManager
- Inherits:
-
Object
- Object
- ET::ArchiveManager
- Defined in:
- lib/et/archive_manager.rb
Instance Attribute Summary collapse
-
#archive ⇒ Object
readonly
Returns the value of attribute archive.
-
#destination ⇒ Object
readonly
Returns the value of attribute destination.
-
#unpacked_files ⇒ Object
readonly
Returns the value of attribute unpacked_files.
Instance Method Summary collapse
- #delete_archive ⇒ Object
-
#initialize(archive, destination) ⇒ ArchiveManager
constructor
A new instance of ArchiveManager.
- #unpack ⇒ Object
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
#archive ⇒ Object (readonly)
Returns the value of attribute archive.
4 5 6 |
# File 'lib/et/archive_manager.rb', line 4 def archive @archive end |
#destination ⇒ Object (readonly)
Returns the value of attribute destination.
4 5 6 |
# File 'lib/et/archive_manager.rb', line 4 def destination @destination end |
#unpacked_files ⇒ Object (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_archive ⇒ Object
11 12 13 |
# File 'lib/et/archive_manager.rb', line 11 def delete_archive File.delete(archive) end |
#unpack ⇒ Object
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 |