lib/awestruct/deploy/rsync_deploy.rb in awestruct-0.5.4.rc3 vs lib/awestruct/deploy/rsync_deploy.rb in awestruct-0.5.4
- old
+ new
@@ -25,28 +25,32 @@
stdin.close
threads = []
threads << Thread.new(stdout) do |i|
while ( ! i.eof? )
line = i.readline
- case line[0,9]
+ head = line[0,9]
+ file = line[10..-1].chomp
+ case head
when '<f.sT....'
- $LOG.info " updating #{line[10..-1]}" if $LOG.info?
+ $LOG.info " updating #{file}" if $LOG.info?
when 'cd+++++++'
- $LOG.info " creating #{line[10..-1]}" if $LOG.info?
+ $LOG.info " creating #{file}" if $LOG.info?
when '<f+++++++'
- $LOG.info " adding #{line[10..-1]}" if $LOG.info?
+ $LOG.info " adding #{file}" if $LOG.info?
when '<f..T....'
# ignoring unchanged files
- $LOG.debug " no change to #{line[10..-1]}" if $LOG.debug?
+ $LOG.debug " no change to #{file}" if $LOG.debug?
+ when '*deleting'
+ $LOG.info " deleting #{file}" if $LOG.info?
else
- $LOG.info line if $LOG.info
+ $LOG.debug line if $LOG.debug
end
end
end
threads << Thread.new(stderr) do |i|
while ( ! i.eof? )
line = i.readline
- $LOG.info line if $LOG.info?
+ $LOG.error line if $LOG.error?
end
end
threads.each{|t|t.join}
end
end