This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set :deploy_via, :remote_cache | |
set :branch, "release" | |
namespace :git do | |
namespace :ensure do | |
desc "Check if your local branch is synched with remote branch" | |
task :pushed do | |
local = `git rev-parse #{branch}`.chomp | |
remote = `git rev-parse remotes/origin/#{branch}`.chomp | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def resize_and_crop(blob, w0, h0, w1, h1) | |
image = MiniMagick::Image.read(blob) | |
rw = w1.to_f / w0 | |
rh = h1.to_f / h0 | |
unless rw > 1 or rh > 1 | |
w,h = w1, h1 | |
sx, sy = 0, 0 | |
NewerOlder