lib/chake/backend.rb in chake-0.1.7 vs lib/chake/backend.rb in chake-0.2
- old
+ new
@@ -1,9 +1,24 @@
module Chake
class Backend < Struct.new(:node)
+ class CommandFailed < Exception
+ end
+
+ def scp
+ ['scp']
+ end
+
+ def scp_dest
+ ''
+ end
+
+ def rsync
+ ['rsync']
+ end
+
def rsync_dest
node.path + '/'
end
def run(cmd)
@@ -14,10 +29,10 @@
end
output.close
if $?
status = $?.exitstatus
if status != 0
- puts [node.hostname, 'FAILED with exit status %d' % status].join(': ')
+ raise CommandFailed.new([node.hostname, 'FAILED with exit status %d' % status].join(': '))
end
end
end
def run_as_root(cmd)