Sha256: 3a2108aae2003a151cbb379699cbeac72eeee762f3ddac0b8a4c5266afe90fa0

Contents?: true

Size: 504 Bytes

Versions: 1

Compression:

Stored size: 504 Bytes

Contents

require 'open3'

module RdiffSimple
  class RdiffBackup
    attr_reader :output_log

    def execute(*args)
      raise NotInstalledError, 'rdiff-backup not installed' unless installed?

      command = ['rdiff-backup', args].flatten!.compact.join(' ').strip

      @output_log, status = Open3.capture2e(command)
      status == EXIT_CODE[:success]
    end

    private
    def installed?
      output, status = Open3.capture2e(COMMANDS[:installed])
      status == EXIT_CODE[:success]
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rdiff-simple-0.0.9 lib/rdiff_simple/rdiff_backup.rb