Sha256: f01a32b5d24b8d46733c8ab5d21ad9ef0ce5e64b17d918386ff0720e8a65075f

Contents?: true

Size: 478 Bytes

Versions: 10

Compression:

Stored size: 478 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]] * " "
      end

    end
  end
end

Version data entries

10 entries across 10 versions & 4 rubygems

Version Path
astrails-safe-0.1.1 lib/astrails/safe/archive.rb
astrails-safe-0.1.2 lib/astrails/safe/archive.rb
astrails-safe-0.1.3 lib/astrails/safe/archive.rb
astrails-safe-0.1.4 lib/astrails/safe/archive.rb
astrails-safe-0.1.6 lib/astrails/safe/archive.rb
colin-safe-0.1.6 lib/astrails/safe/archive.rb
colin-safe-0.1.7 lib/astrails/safe/archive.rb
colin-safe-0.1.8 lib/astrails/safe/archive.rb
markmansour-safe-0.1.7 lib/astrails/safe/archive.rb
ralph-safe-0.1.7 lib/astrails/safe/archive.rb