This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| search(:users).each do |user| | |
| puts "Found #{user.id}" | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
NewerOlder