Class: Mamiya::Steps::Extract

Inherits:
Abstract
  • Object
show all
Defined in:
lib/mamiya/steps/extract.rb

Instance Attribute Summary

Attributes inherited from Abstract

#config, #logger, #options, #script

Instance Method Summary collapse

Methods inherited from Abstract

#initialize

Constructor Details

This class inherits a constructor from Mamiya::Steps::Abstract

Instance Method Details

#run!Object

XXX: extract step is really needed? doing this in prepare step for consistency with agent/tasks/prepare, is better, I guess.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/mamiya/steps/extract.rb', line 8

def run!
  package = case options[:package]
            when Mamiya::Package
              options[:package]
            else
              Mamiya::Package.new(options[:package])
            end

  if File.exists?(options[:destination])
    destination = File.join(options[:destination], package.name)
  else
    destination = options[:destination]
  end

  logger.info "Extracting #{package.path} onto #{destination}"
  package.extract_onto!(destination)
end