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
# An example of how to handle migrations that *might* fail because they've already happened. | |
class FixUpMigrations < ActiveRecord::Migration | |
def self.up | |
say_with_time %{ | |
If you are transitioning from 0.6.9 to 0.7.1, these migrations | |
were lost. We're not worried if the columns already exist. | |
} do | |
maybe_add_column 'duplicate column name', | |
:pages, :is_preview, :boolean, :default => false | |
maybe_add_column 'duplicate column name', |
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
Highrise::Person.class_eval do | |
class << self | |
def lookup(id, list, item, location) | |
module_eval <<-EOT | |
def #{id} | |
contact_data.#{list}.each do |i| | |
return i.#{item}.strip if i.location == "#{location}" | |
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
* executing `deploy' | |
* executing `deploy:update' | |
** transaction: start | |
* executing `deploy:update_code' | |
updating the cached checkout on all servers | |
executing locally: "git ls-remote git@freesailquotes.unfuddle.com:freesailquotes/site.git master" | |
* executing "if [ -d /var/www/freesailquotes.com/shared/cached-copy ]; then cd /var/www/freesailquotes.com/shared/cached-copy && git fetch origin && git reset --hard a25dc8d1b4ededb3cbfb14d41ff61dbb5660b7c4 && git submodule init && git submodule update; else git clone --depth 1 git@freesailquotes.unfuddle.com:freesailquotes/site.git /var/www/freesailquotes.com/shared/cached-copy && cd /var/www/freesailquotes.com/shared/cached-copy && git checkout -b deploy a25dc8d1b4ededb3cbfb14d41ff61dbb5660b7c4 && git submodule init && git submodule update; fi" | |
servers: ["li82-69.members.linode.com"] | |
D, [2009-06-20T19:49:15.628964 #47194] DEBUG -- net.ssh.transport.session[d2f91a]: establishing connection to li82-69.members.linode.com:22 | |
D, [2009-06-20T1 |
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
while true do | |
RefineryQueue.stats_update | |
sleep 60 | |
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
/var/log/nginx/*.log { daily | |
missingok | |
rotate 52 | |
compress | |
delaycompress | |
notifempty | |
create 640 root adm | |
sharedscripts | |
postrotate | |
[ ! -f /var/run/nginx.pid ] || kill -USR1 `cat /var/run/nginx.pid` |
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
// Matches all hosts that start with "local." | |
// The funky regex matches the port number (if include in the URL) | |
function FindProxyForURL(url, host) { | |
if (shExpMatch(host,"local.*")) { | |
port = url.match( /\w+:\/\/[^:]+(:\d+)\// ); | |
if (port) { | |
return "PROXY localhost" + port[1]; | |
} else { | |
return "PROXY localhost"; | |
} |
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
# spec/support/holygrail.rb | |
require 'holygrail' | |
class Spec::Rails::Example::ControllerExampleGroup | |
include ::HolyGrail::Extensions | |
end | |
class Spec::Rails::Example::FunctionalExampleGroup | |
include ::HolyGrail::Extensions | |
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
<% | |
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : "" | |
rerun_opts = rerun.to_s.strip.empty? ? "--format progress features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}" | |
std_opts = "#{rerun_opts} --format rerun --out rerun.txt --strict --tags ~@wip --tags ~@pending --color --require features/" | |
all_opts = "--format progress --strict --tags ~@wip --tags ~@pending --color" | |
%> | |
autotest: --format pretty --tags @wip --wip --tags ~@spreedly features | |
autotest-all: --format progress --tags ~@pending --tags ~@spreedly features | |
default: <%= std_opts %> | |
all: <%= all_opts %> |
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
# For mocha integration, add this file into features/support folder | |
require "mocha" | |
World(Mocha::API) | |
Before do | |
mocha_setup | |
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
class BrandSweeper < ActionController::Caching::Sweeper | |
observe Brand # Observers will introspect on the class, but Sweepers don't | |
def after_update(brand) | |
expire_action :controller => "brand", :action => :preview, :brand_id => brand.to_param | |
end | |
... |
OlderNewer