From 9f73849869869af06857feec4f268cc0cb098379 Mon Sep 17 00:00:00 2001 From: Phil Date: Thu, 6 Feb 2014 13:24:44 -0500 Subject: [PATCH] fix for defaults options overwriting settings --- lib/capistrano/rsync.rb | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/capistrano/rsync.rb b/lib/capistrano/rsync.rb index 758d96b..1950d39 100644 --- a/lib/capistrano/rsync.rb +++ b/lib/capistrano/rsync.rb @@ -5,16 +5,25 @@ # private API and internals of Capistrano::Rsync. If you think something should # be public for extending and hooking, please let me know! -set :rsync_options, [] -set :rsync_copy, "rsync --archive --acls --xattrs" +fetch(:rsync_options) do + set :rsync_options, [] +end + +fetch(:rsync_copy) do + set :rsync_copy, "rsync --archive --acls --xattrs" +end # Stage is used on your local machine for rsyncing from. -set :rsync_stage, "tmp/deploy" +fetch(:rsync_stage) do + set :rsync_stage, "tmp/deploy" +end # Cache is used on the server to copy files to from to the release directory. # Saves you rsyncing your whole app folder each time. If you nil rsync_cache, # Capistrano::Rsync will sync straight to the release path. -set :rsync_cache, "shared/deploy" +fetch(:rsync_cache) do + set :rsync_cache, "shared/deploy" +end rsync_cache = lambda do cache = fetch(:rsync_cache)