lib/rdiff_simple.rb in rdiff-simple-0.0.3 vs lib/rdiff_simple.rb in rdiff-simple-0.0.4
- old
+ new
@@ -1,15 +1,30 @@
require "rdiff_simple/version"
+
+module RdiffSimple
+
+ class NotInstalledError < Exception; end
+
+ def self.execute(*args)
+ raise NotInstalledError, 'rdiff-backup not installed' unless installed?
+
+ system('rdiff-backup', *args)
+ end
+
+ def self.installed?
+ system('which rdiff-backup')
+ end
+end