 # Gulp
-gulp        = require "gulp"
-coffee      = require "gulp-coffee"
-concat      = require "gulp-concat"
-exec        = require "gulp-exec"
-minifyCSS   = require "gulp-minify-css"
-plumber     = require "gulp-plumber"
-rename      = require "gulp-rename"
-sass        = require "gulp-sass"
-uglify      = require "gulp-uglify"
-gutil       = require "gulp-util"
-watch       = require "gulp-watch"
-shell       = require "gulp-shell"
-browserSync = require "browser-sync"
-reload      = browserSync.reload
-imagemin    = require "gulp-imagemin"
-pngquant    = require "imagemin-pngquant"
-rsync 			= require "gulp-rsync"
+gulp        	= require "gulp"
+coffee      	= require "gulp-coffee"
+concat      	= require "gulp-concat"
+exec        	= require "gulp-exec"
+minifyCSS   	= require "gulp-minify-css"
+plumber     	= require "gulp-plumber"
+rename      	= require "gulp-rename"
+sass        	= require "gulp-sass"
+uglify      	= require "gulp-uglify"
+gutil       	= require "gulp-util"
+watch       	= require "gulp-watch"
+shell       	= require "gulp-shell"
+browserSync 	= require "browser-sync"
+reload      	= browserSync.reload
+imagemin    	= require "gulp-imagemin"
+pngquant    	= require "imagemin-pngquant"
+rsyncwrapper	= require "rsyncwrapper"
+rsync 				= rsyncwrapper.rsync
 
 # Extra
-extend 			= require "extend"
-
-pkg = require './package.json'
-conf = require './Gulpconfig.json'
+extend 				= require "extend"
+
+pkg   = require './package.json'
+conf  = require './Gulpconfig.json'
 try
 	pvt = require './private.json'
 catch err

#   $RSYNC
#*------------------------------------*/
# rsync files to and from production
gulp.task 'rsync:up', () ->
  gulp.src '~dewald/ssh-test'
    .pipe rsync extend conf.rsyncOptions, { hostname: pvt.domain, username: pvt.username }

# 	rsync:
# 		options:
# 			args: ["--archive", "--itemize-changes", "--progress", "--compress"]
# 			exclude: [
# 				".git*",
# 				".DS_Store",
# 				"node_modules",
# 				".sass-cache",
# 				"*.scss",
# 				"*.css.map",
# 				"assets/css/style.css",
# 				"assets/js/main.js",
# 				"*.js.map",
# 				"*.coffee",
# 				"config-dev.php",
# 				"assets/cache",
# 				"assets/files",
# 				"assets/sessions",
# 				"assets/logs"
# 			]
# 			recursive: true

# dry-run down

# 		downdry:
# 			options:
# 				args: ["--dry-run", "--verbose"]
# 				src: "<%= pvt.username %>@<%= pvt.domain %>:public_html/"
# 				dest: "src"
# 				syncDestIgnoreExcl: true

# sync down

# 		down:
# 			options:
# 				src: "<%= pvt.username %>@<%= pvt.domain %>:public_html/"
# 				dest: "src"
# 				syncDestIgnoreExcl: true

# staging dry-run down

# 		#
# 		# only sync files that have been uploaded
# 		stagingdowndry:
# 			options:
# 				args: ["--dry-run", "--verbose"]
# 				src: "<%= pvt.username %>@<%= pvt.domain %>:public_html/staging.<%= pvt.domain %>/site/assets/files/"
# 				dest: "src/site/assets/files"
# 				syncDestIgnoreExcl: true

# sync staging to local

# 		#
# 		# only sync files that have been uploaded
# 		stagingdown:
# 			options:
# 				src: "<%= pvt.username %>@<%= pvt.domain %>:public_html/staging.<%= pvt.domain %>/site/assets/files/"
# 				dest: "src/site/assets/files"
# 				syncDestIgnoreExcl: true

# dry-run sync to prod

# 		updry:
# 			options:
# 				args: ["--dry-run", "--verbose"]
# 				src: "src/"
# 				dest: "public_html"
# 				host: "<%= pvt.username %>@<%= pvt.domain %>"

# sync to pro

# 		up:
# 			options:
# 				src: "src/"
# 				dest: "public_html"
# 				host: "<%= pvt.username %>@<%= pvt.domain %>"

# dry-run deploy to staging

# 		stagingupdry:
# 			options:
# 				args: ["--dry-run", "--verbose"]
# 				exclude: [
# 					".git*",
# 					".DS_Store",
# 					"node_modules",
# 					"config-dev.php",
# 					".sass-cache",
# 					"*.scss",
# 					"*.css.map",
# 					"assets/css/style.css",
# 					"assets/js/main.js",
# 					"*.js.map",
# 					"*.coffee",
# 					"assets/cache",
# 					"assets/files",
# 					"assets/logs",
# 					"assets/sessions",
# 					"config.php",
# 					"robots.txt"
# 				]
# 				src: "src/"
# 				dest: "public_html/staging.<%= pvt.domain %>"
# 				host: "<%= pvt.username %>@<%= pvt.domain %>"

# deploy local changes to staging

# 		stagingup:
# 			options:
# 				src: "src/"
# 				exclude: [
# 					".git*",
# 					".DS_STORE",
# 					"node_modules",
# 					"config-dev.php",
# 					".sass-cache",
# 					"*.scss",
# 					"*.css.map",
# 					"assets/css/style.css",
# 					"assets/js/main.js",
# 					"*.js.map",
# 					"*.coffee",
# 					"assets/cache",
# 					"assets/files",
# 					"assets/logs",
# 					"assets/sessions",
# 					"config.php",
# 					"robots.txt"
# 				]
# 				dest: "public_html/staging.<%= pvt.domain %>"
# 				host: "<%= pvt.username %>@<%= pvt.domain %>"


#*------------------------------------*\

# grunt's devUpdate:check alternative
# grunt's devUpdate:ask alternative
# grunt's devUpdate:up alternative

