Sha256: ac4ed81d3486fd86c2cafb4641e83fa39b8ec1e425f79a4328da3b345b7e8ccf

Contents?: true

Size: 495 Bytes

Versions: 2

Compression:

Stored size: 495 Bytes

Contents

require 'open3'

module RdiffSimple
  module RdiffBackup
    def self.execute(*args)
      raise NotInstalledError, 'rdiff-backup not installed' unless installed?

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

      output, status = Open3.capture2e(command)
      STDOUT.write output
      status == EXIT_CODE[:success]
    end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rdiff-simple-0.0.8 lib/rdiff_simple/rdiff_backup.rb
rdiff-simple-0.0.7 lib/rdiff_simple/rdiff_backup.rb