Sha256: afb86725dfbcbf7f342a12b9b9d25aaf41dd05086646565e1d38e635df9f9000

Contents?: true

Size: 381 Bytes

Versions: 6

Compression:

Stored size: 381 Bytes

Contents

require 'singleton'

module Chake
  class Wipe
    include Singleton

    if system('which', 'wipe', out: '/dev/null', err: :out)
      def wipe(file)
        system('wipe', '-rfs', file)
      end
    else
      warn 'W: please install the \`wipe\` program for secure deletion, falling back to unlink(2)'
      def wipe(file)
        File.unlink(file)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
chake-0.91 lib/chake/wipe.rb
chake-0.90.3 lib/chake/wipe.rb
chake-0.90.2 lib/chake/wipe.rb
chake-0.90.1 lib/chake/wipe.rb
chake-0.90 lib/chake/wipe.rb
chake-0.82 lib/chake/wipe.rb