Eliminating ternary op.

This commit is contained in:
Jon Frisby 2013-02-28 19:53:11 -08:00
parent d6b6b0d80e
commit c20c2a7acd

View File

@ -298,7 +298,11 @@ task :rsync do
exclude = "--exclude-from '#{File.expand_path('./rsync-exclude')}'" exclude = "--exclude-from '#{File.expand_path('./rsync-exclude')}'"
end end
puts "## Deploying website via Rsync" 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]) 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}") 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 end