Class: Avm::Data::Package::Load

Inherits:
BasePerformer show all
Includes:
BuildDirectory
Defined in:
lib/avm/data/package/load.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BasePerformer

#excludes, #includes, #selected_units

Constructor Details

#initialize(package, source_path, options = {}) ⇒ Load

Returns a new instance of Load.



18
19
20
21
# File 'lib/avm/data/package/load.rb', line 18

def initialize(package, source_path, options = {})
  super(package, options)
  @source_path = source_path.to_pathname
end

Instance Attribute Details

#source_pathObject (readonly)

Returns the value of attribute source_path.



16
17
18
# File 'lib/avm/data/package/load.rb', line 16

def source_path
  @source_path
end

Instance Method Details

#extract_packages_to_build_directoryObject



30
31
32
# File 'lib/avm/data/package/load.rb', line 30

def extract_packages_to_build_directory
  ::Minitar.unpack(source_path.to_path, build_directory.to_path)
end

#resultObject



23
24
25
26
27
28
# File 'lib/avm/data/package/load.rb', line 23

def result
  on_build_directory do
    extract_packages_to_build_directory
    package.load_units_from_directory(build_directory, selected_units)
  end
end