From c20c2a7acd2607b6b48a8f81bcb65e723f293ad9 Mon Sep 17 00:00:00 2001 From: Jon Frisby Date: Thu, 28 Feb 2013 19:53:11 -0800 Subject: [PATCH] Eliminating ternary op. --- Rakefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index b76596c..c5a492f 100644 --- a/Rakefile +++ b/Rakefile @@ -298,7 +298,11 @@ task :rsync do exclude = "--exclude-from '#{File.expand_path('./rsync-exclude')}'" end puts "## Deploying website via Rsync" - ssh_key = (!configuration[:ssh_key].nil? && !configuration[:ssh_key].empty?) ? "-i #{ENV['HOME']}/.ssh/#{configuration[:ssh_key]}" : "" + ssh_key = if(!configuration[:ssh_key].nil? && !configuration[:ssh_key].empty?) + "-i #{ENV['HOME']}/.ssh/#{configuration[:ssh_key]}" + else + "" + end document_root = ensure_trailing_slash(configuration[:document_root]) ok_failed system("rsync -avze 'ssh -p #{configuration[:ssh_port]} #{ssh_key}' #{exclude} #{configuration[:rsync_args]} #{"--delete" unless !configuration[:rsync_delete]} #{ensure_trailing_slash(configuration[:destination])} #{configuration[:ssh_user]}:#{document_root}") end