Skip to content

Instantly share code, notes, and snippets.

View chef.rb
def 'chef installed' do
requires 'chef', 'ohai'
define_var :server_name, :default => shell('hostname -f')
# this needs to go somewhere, like ~/solo.rb
solo_rb = %Q{
file_cache_path "/tmp/chef-solo"
cookbook_path "/tmp/chef-solo/cookbooks"
recipe_url "http://s3.amazonaws.com/chef-solo/bootstrap-latest.tar.gz"
}
View gist:36960
def number_to_ordinal num
int = num.to_i
int.to_s + ((10...20) === int) ? "th" : (%w{th st nd rd}[int % 10] or "th")
end