save_and_open_page
have_button(locator)
require 'net/http' | |
module CouchDB | |
class Server | |
def initialize(host, port, options = nil) | |
@host = host | |
@port = port | |
@options = options | |
end |
# SQLite version 3.x | |
# gem install sqlite3-ruby (not necessary on OS X Leopard) | |
development: | |
adapter: sqlite3 | |
database: db/development.sqlite3 | |
pool: 5 | |
timeout: 5000 | |
# Warning: The database defined as "test" will be erased and | |
# re-generated from your development database when you run "rake". |
# exceptions cheatsheet from Avdi Grimm talk | |
# talk: http://confreaks.net/videos/523-roa2011-exceptional-ruby | |
# retry | |
begin | |
rescue | |
retry |
# Knife Configuration File. | |
# | |
# This is a Ruby DSL to set configuration parameters for Knife's | |
# general options. The default location for this file is | |
# ~/.chef/knife.rb. If multiple Chef repositories are used, | |
# per-repository configuration files can be created. A per repository | |
# configuration file must be .chef/knife.rb in the base directory of | |
# the Chef repository. For example, | |
# | |
# ~/Development/chef-repo/.chef/knife.rb |
--colour | |
-I app |
# Ship it! rake task | |
# | |
# Merge branch (master by default) to deployment branch, and deploy to server. | |
# | |
# Prerequisite: | |
# | |
# * Declare all deployment branches in `ALL_DEPLOYMENT_BRANCHES` | |
# * Declare deploy only branches in `DEPLOY_ONLY_BRANCHES` (ie, does not merge master) | |
# * Modify `Deploy.command` function as necessary | |
# |
class Address < ActiveRecord::Base | |
attr_accessible :postcode | |
validates_format_of :postcode, :with => /^([A-PR-UWYZ]([0-9]{1,2}|([A-HK-Y][0-9]|[A-HK-Y][0-9]([0-9]|[ABEHMNPRV-Y]))|[0-9][A-HJKS-UW])\s?[0-9][ABD-HJLNP-UW-Z]{2}|(GIR\ 0AA)|(SAN\ TA1)|(BFPO\ (C\/O\ )?[0-9]{1,4})|((ASCN|BBND|[BFS]IQQ|PCRN|STHL|TDCU|TKCA)\ 1ZZ))$$/i, :message => "invalid postcode" | |
end |
method PageHeaderHelper
def page_header(title, subtitle = nil, &contents)
PageHeader.new(self, title, subtitle, &contents)
end
class PageHeader
attr_reader :context, :title, :subtitle
def initialize(context, title, subtitle = nil)