Skip to content

Instantly share code, notes, and snippets.

View kfaustino's full-sized avatar

Kevin Faustino kfaustino

View GitHub Profile
# How to give your devise controllers all the same layout (e.g. "authentication" below)
class ApplicationController < ActionController::Base
layout :setup_layout
protected
def setup_layout
devise_controller? ? "authentication" : "application"
end
end
desc "Generate and deploy assets"
task :deploy_assets, :roles => :app do
# get the previous timestamp
old_timestamp = File.read("config/deploy_timestamp").to_i rescue 0
# generate timestamp into config/deploy_timestamp
timestamp = Time.now.to_i
File.open("config/deploy_timestamp", 'w') do |f|
f.write(timestamp)
end
require "integrity"
Integrity.new(File.dirname(__FILE__) + "/config.yml")
project = Integrity::Project.first(:name => "Project Foo")
unless `git ls-remote #{project.uri}`.include?(project.commits.last)
project.build
end