Class: Avm::Data::Package::Load
- Inherits:
-
Object
- Object
- Avm::Data::Package::Load
- Includes:
- BuildDirectory
- Defined in:
- lib/avm/data/package/load.rb
Instance Method Summary collapse
- #cannot_run_reason ⇒ Object
- #data_file_exist? ⇒ Boolean
- #extract_packages_to_build_directory ⇒ Object
- #run ⇒ Object
- #runnable? ⇒ Boolean
Instance Method Details
#cannot_run_reason ⇒ Object
20 21 22 23 24 |
# File 'lib/avm/data/package/load.rb', line 20 def cannot_run_reason return nil if data_file_exist? "Data file \"#{data_file_path}\" does not exist" end |
#data_file_exist? ⇒ Boolean
35 36 37 |
# File 'lib/avm/data/package/load.rb', line 35 def data_file_exist? ::File.exist?(data_file_path) end |
#extract_packages_to_build_directory ⇒ Object
39 40 41 |
# File 'lib/avm/data/package/load.rb', line 39 def extract_packages_to_build_directory ::Minitar.unpack(data_file_path, build_directory.to_path) end |
#run ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/avm/data/package/load.rb', line 26 def run raise "Cannot run: #{cannot_run_reason}" unless runnable? on_build_directory do extract_packages_to_build_directory package.load_units_from_directory(build_directory) end end |
#runnable? ⇒ Boolean
16 17 18 |
# File 'lib/avm/data/package/load.rb', line 16 def runnable? cannot_run_reason.blank? end |