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.



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

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.



13
14
15
# File 'lib/avm/data/package/load.rb', line 13

def source_path
  @source_path
end

Instance Method Details

#extract_packages_to_build_directoryObject



27
28
29
# File 'lib/avm/data/package/load.rb', line 27

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

#resultObject



20
21
22
23
24
25
# File 'lib/avm/data/package/load.rb', line 20

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