Sha256: d126cff38fb42ef302f9fad92358007e246adafd4997a261212993ea96e6d567

Contents?: true

Size: 495 Bytes

Versions: 11

Compression:

Stored size: 495 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

11 entries across 11 versions & 3 rubygems

Version Path
astrails-safe-0.1.10 lib/astrails/safe/archive.rb
astrails-safe-0.1.7 lib/astrails/safe/archive.rb
astrails-safe-0.1.8 lib/astrails/safe/archive.rb
astrails-safe-0.1.9 lib/astrails/safe/archive.rb
astrails-safe-0.2.0 lib/astrails/safe/archive.rb
astrails-safe-0.2.1 lib/astrails/safe/archive.rb
astrails-safe-0.2.2 lib/astrails/safe/archive.rb
astrails-safe-0.2.3 lib/astrails/safe/archive.rb
bostonlogic-safe-0.3.0 lib/astrails/safe/archive.rb
webbynode-safe-0.2.5 lib/astrails/safe/archive.rb
astrails-safe-0.2.4 lib/astrails/safe/archive.rb