Skip to content

Instantly share code, notes, and snippets.

configuration do
application 'test-application'
path "/srv/app/test/#{application}"
repository 'git@example.org:project.git'
tunnel true
end
target :staging do
branch 'staging'
app 'user@staging.example.org'
validate_presence_of :name, :if => :should_validate_name?
def should_validate_name?
parent_object.has_certain_properties?
end
validate :custom_validation_method
def custom_validation_method
if parent_object.has_stuff? && name.blank?
errors.add :name, 'should not be blank when parent object has stuff'
end
end
desc "Migrate all of the databases"
task :migrate_all => :environment do
Customer.connect_each do |customer|
puts "Migrating #{customer.environment}"
ActiveRecord::Migrator.migrate "db/migrate/"
end
end
config/database.yml
db/schema.rb
db/*.sqlite3
doc/app
doc/diagrams
log/*.log
tmp/*
#!/usr/bin/ruby -w
=begin
/***************************************************************************
* Copyright (C) 2008, Paul Lutus *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
http://localhost:4567/b71e6394-cb6a-4bf3-859f-d8b11fc86764/api
begin
require 'hanna/rdoctask'
rescue LoadError
require 'rake/rdoctask'
end
function getElementXPath(elt)
{
var path = "";
for (; elt && elt.nodeType == 1; elt = elt.parentNode)
{
idx = getElementIdx(elt);
xname = elt.tagName;
if (idx > 1) xname += "[" + idx + "]";
path = "/" + xname + path;
}
function getElementXPath(elt)
{
var path = "";
for (; elt && elt.nodeType == 1; elt = elt.parentNode)
{
idx = getElementIdx(elt);
xname = elt.tagName;
if (idx > 1) xname += "[" + idx + "]";
path = "/" + xname + path;
}