Sha256: ffe120d4198569fa688d22a75dd8e51e794350af1689e489e075711c4a0cb094

Contents?: true

Size: 496 Bytes

Versions: 3

Compression:

Stored size: 496 Bytes

Contents

module Astrails
  module Safe
    class Archive < Source

      def command
        "tar -cf - #{@config[:options]} #{tar_exclude_files} #{tar_files}"
      end

      def extension; '.tar'; end

      protected

      def tar_exclude_files
        [*@config[:exclude]].compact.map{|x| "--exclude=#{x}"} * " "
      end

      def tar_files
        raise RuntimeError, "missing files for tar" unless @config[:files]
        [*@config[:files]].map {|s| s.strip} * " "
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
astrails-safe-0.2.7 lib/astrails/safe/archive.rb
astrails-safe-0.2.6 lib/astrails/safe/archive.rb
astrails-safe-0.2.5 lib/astrails/safe/archive.rb