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
# 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 |
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
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 |
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
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 |