Sha256: 044e82419991434e13b61d427e7bb08cc67e41018f26bb40374ccd6e9360cde2

Contents?: true

Size: 1.18 KB

Versions: 17

Compression:

Stored size: 1.18 KB

Contents

module Nucleon
module Action
class Extract < Nucleon.plugin_class(:nucleon, :action)
  
  #-----------------------------------------------------------------------------
  # Info
  
  def self.describe
    super(nil, :extract, -50)
  end
  
  #-----------------------------------------------------------------------------
  # Settings
  
  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
  
  #---
  
  def arguments
    [ :path, :encoded ]
  end
 
  #-----------------------------------------------------------------------------
  # Operations
  
  def execute
    super do
      unless @package.extract(settings[:path])
        myself.status = code.extract_failure
      end
    end
  end
end
end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
nucleon-0.2.16 lib/nucleon/action/extract.rb
nucleon-0.2.15 lib/nucleon/action/extract.rb
nucleon-0.2.14 lib/nucleon/action/extract.rb
nucleon-0.2.13 lib/nucleon/action/extract.rb
nucleon-0.2.12 lib/nucleon/action/extract.rb
nucleon-0.2.11 lib/nucleon/action/extract.rb
nucleon-0.2.10 lib/nucleon/action/extract.rb
nucleon-0.2.9 lib/nucleon/action/extract.rb
nucleon-0.2.8 lib/nucleon/action/extract.rb
nucleon-0.2.7 lib/nucleon/action/extract.rb
nucleon-0.2.6 lib/nucleon/action/extract.rb
nucleon-0.2.5 lib/nucleon/action/extract.rb
nucleon-0.2.4 lib/nucleon/action/extract.rb
nucleon-0.2.3 lib/nucleon/action/extract.rb
nucleon-0.2.2 lib/nucleon/action/extract.rb
nucleon-0.2.1 lib/nucleon/action/extract.rb
nucleon-0.2.0 lib/nucleon/action/extract.rb