Skip to content

Instantly share code, notes, and snippets.

View jellybob's full-sized avatar

Jon Wood jellybob

View GitHub Profile
search(:users).each do |user|
puts "Found #{user.id}"
end
@jellybob
jellybob / Client Only
Created January 28, 2010 12:40 — forked from btm/build_chef_0.8
Installing on Debian sid
echo "deb ftp://mir1.ovh.net/debian/ sid main contrib non-free" > /etc/apt/sources.list
echo "deb-src ftp://mir1.ovh.net/debian/ sid main contrib non-free" >> /etc/apt/sources.list
apt-get update
apt-get install -y ruby ruby1.8-dev libopenssl-ruby1.8 rdoc ri irb build-essential wget ssl-cert rubygems git-core rake liblibxml-ruby librspec-ruby zlib1g-dev libxml2-dev
gem sources -a http://gems.opscode.com
gem install jeweler merb-core cucumber uuidtools json libxml-ruby --no-ri --no-rdoc
mkdir ~/src
cd ~/src
git clone git://github.com/opscode/chef.git
git clone git://github.com/opscode/ohai.git
def me
user_classes = ["User", "Account"]
methods = [:email_address, :email, :username, :login]
user_classes.each do |class_name|
begin
klass = class_name.constantize
methods.each do |method|
return klass.send("find_by_#{method}", "[email protected]") if klass.new.respond_to?(method)
end