Skip to content

Instantly share code, notes, and snippets.

class CitizenshipStatus
include Processor
def process_field(value)
AlienStatus.find_code( value )
end
end
@lgrains
lgrains / instrument.rb
Created November 7, 2013 21:39
Taking a vote. Which looks cleaner and more rubyesque?
require 'ostruct'
class Instrument < OpenStruct
def self.instruments_array
InstrumentsCSVReader.get_from_file
end
def self.all
@all ||= instruments_array.map { |n| new(n) }
module Seed
class CourseRequirement < OpenStruct
include Gardener
def self.destroyable?
true
end
def attributes
{ coming_soon: coming_soon }
@lgrains
lgrains / Problems installing Postgres on 10.7.4
Created January 12, 2013 15:58
Files requested from here: https://github.com/mxcl/homebrew/wiki/troubleshooting when brew fails to install programs
HOMEBREW_MAKE_JOBS=1 VERBOSE=1 brew install postgres
==> Downloading http://ftp.postgresql.org/pub/source/v9.2.2/postgresql-9.2.2.tar.bz2
Already downloaded: /Users/rainyglade/Library/Caches/Homebrew/postgresql-9.2.2.tar.bz2
/usr/bin/tar xf /Users/rainyglade/Library/Caches/Homebrew/postgresql-9.2.2.tar.bz2
==> Patching
/usr/bin/patch -f -p1 -i 000-homebrew.diff
patching file src/pl/plpython/Makefile
patching file contrib/uuid-ossp/uuid-ossp.c
==> ./configure --disable-debug --prefix=/usr/local/Cellar/postgresql/9.2.2 --datadir=/usr/local/Cellar/postgresql/9.2.2/share/postgresql --docdir=/usr/local/Cellar/postgresql/9.2.2/share/doc/postgresql --enable-thread-safety --with-bonjour --with-gssapi --with-krb5 --with-openssl --with-libxml --with-libxslt --with-ossp-uuid --with-python --with-perl ARCHFLAGS='-arch x86_64'
./configure --disable-debug --prefix=/usr/local/Cellar/postgresql/9.2.2 --datadir=/usr/local/Cellar/postgresql/9.2.2/share/postgresql --docdir=/usr/local/Cellar/postgresql/9.2.2/share/doc/postgresql