Sha256: 19c3c881a1377d0419c40ab8628c499cea9287ccd3ddc3319310555c44a7e166

Contents?: true

Size: 593 Bytes

Versions: 2

Compression:

Stored size: 593 Bytes

Contents

require 'chrysalis/ar/tar'


module Chrysalis
module Ar

  # Implements support for extracting tar archives compressed with bzip2
  # compression.
  #
  # Archives of this type are identified by the file extension <em>.tar.bz2</em>.
  class TarBz2Archive < TarArchive
    
    EXTENSION = ".tar.bz2".freeze
    
    def self.extracts?(path)
      path.end? EXTENSION
    end
    
    protected
      def flags
        "xjvf"
      end
      
      def extracts_into
        return @extracts_into if @extracts_into
        Pathname.new(@path).basename(EXTENSION)
      end
    
  end

end 
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
chrysalis-0.1.0 lib/chrysalis/ar/tar_bz2.rb
chrysalis-0.1.1 lib/chrysalis/ar/tar_bz2.rb