Sha256: 745f75f90ee95431f179ce3d1712aafbc66174269d81ec1263c934d125bcda8d

Contents?: true

Size: 503 Bytes

Versions: 7

Compression:

Stored size: 503 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}"}.join(" ")
      end

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

    end
  end
end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
astrails-safe-0.3.1 lib/astrails/safe/archive.rb
astrails-safe-0.3.0 lib/astrails/safe/archive.rb
netguru-safe-0.2.11 lib/astrails/safe/archive.rb
netguru-safe-0.2.10 lib/astrails/safe/archive.rb
netguru-safe-0.2.9 lib/astrails/safe/archive.rb
darkofabijan-astrails-safe-0.2.9 lib/astrails/safe/archive.rb
darkofabijan-astrails-safe-0.2.8 lib/astrails/safe/archive.rb