require 'awestruct/deployers' require 'open3' module Awestruct module Deploy class RSyncDeploy def initialize(site_config, deploy_config) @site_path = File.join( site_config.output_dir, '/' ) @host = deploy_config['host'] @path = File.join( deploy_config['path'], '/' ) end def run cmd = "rsync -r -l -i --no-p --no-g --chmod=Dg+s,ug+w --delete #{@site_path} #{@host}:#{@path}" Open3.popen3( cmd ) do |stdin, stdout, stderr| stdin.close threads = [] threads << Thread.new(stdout) do |i| while ( ! i.eof? ) line = i.readline case line[0,9] when '