Skip to content

Instantly share code, notes, and snippets.

View Packetslave's full-sized avatar

Brian Landers Packetslave

View GitHub Profile
@Packetslave
Packetslave / gist:191209
Created September 22, 2009 16:20
Make capistrano use SCP instead of SFTP
# Deployment uses SFTP by default when you use deploy_via :copy, and there
# doesn't seem to be any way to configure it. Unfortunately, we don't run
# SFTP on our servers, so it fails. This forces it to use SCP instead.
# http://www.capify.org/index.php/OverridingTaskCommands
#
module UseScpForDeployment
def self.included(base)
base.send(:alias_method, :old_upload, :upload)
base.send(:alias_method, :upload, :new_upload)
end
namespace :minifier do
JAR = "/Users/blanders/MyDocs/Library/yuicompressor.jar"
def minify(files)
files.each do |file|
next if file =~ /\.min\.(js|css)/
minfile = file.sub(/\.js$/, ".min.js").sub(/\.css$/, ".min.css")
cmd = "java -jar #{JAR} #{file} -o #{minfile}"