I've been trying to understand how to setup systems from
the ground up on Ubuntu. I just installed redis onto
the box and here's how I did it and some things to look
out for.
To install:
| # Usage: | |
| # 1. Drop this file into lib/capistrano/submodule_strategy.rb | |
| # 2. Add the following to your Capfile: | |
| # require 'capistrano/git' | |
| # require './lib/capistrano/submodule_strategy' | |
| # 3. Add the following to your config/deploy.rb | |
| # set :git_strategy, SubmoduleStrategy | |
| module SubmoduleStrategy | |
| # do all the things a normal capistrano git session would do | 
| #!/usr/bin/ruby | |
| # Create display override file to force Mac OS X to use RGB mode for Display | |
| # see http://embdev.net/topic/284710 | |
| require 'base64' | |
| data=`ioreg -l -d0 -w 0 -r -c AppleDisplay` | |
| edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten | |
| vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten | 
| if [ -f "$rvm_path/scripts/rvm" ]; then | |
| source "$rvm_path/scripts/rvm" | |
| if [ -f ".rvmrc" ]; then | |
| source ".rvmrc" | |
| fi | |
| if [ -f ".ruby-version" ]; then | |
| rvm use `cat .ruby-version` | |
| fi | 
| require 'delegate' | |
| class Klass < DelegateClass(String) | |
| # ... | |
| end | |
| class Klass < DelegateClass(String) | |
| # Re-open the class | |
| end | |
| # => TypeError: superclass mismatch for class Klass | 
| # RSpec2 JSON Matcher for functional/controller tests | |
| # Webrat usage example: | |
| # | |
| # it "should be the JSON representation" do | |
| # get :show, id: object.id, format: :json | |
| # response.body.should be_json_eql object.to_json | |
| # end | |
| require 'rspec/expectations' |