class Nucleon::Action::Extract

Public Class Methods

describe() click to toggle source
# File lib/nucleon/action/extract.rb, line 9
def self.describe
  super(nil, :extract, -50)
end

Public Instance Methods

arguments() click to toggle source
# File lib/nucleon/action/extract.rb, line 40
def arguments
  [ :path, :encoded ]
end
configure() click to toggle source
# File lib/nucleon/action/extract.rb, line 16
def configure
  super do
    codes :extract_failure
       
    register :path, :str, nil do |value|
      unless File.directory?(value)
        warn('nucleon.action.extract.errors.path', { :value => value })
        next false
      end
      true
    end
    register :encoded, :str, nil do |value|
      @package = Util::Package.new(value)
      if @package.data.export.empty?
        warn('nucleon.action.extract.errors.encoded', { :value => value })
        next false  
      end
      true
    end
  end
end
execute() click to toggle source
# File lib/nucleon/action/extract.rb, line 47
def execute
  super do
    unless @package.extract(settings[:path])
      myself.status = code.extract_failure
    end
  end
end