Skip to content

Instantly share code, notes, and snippets.

@mlafeldt
Created November 28, 2012 12:11
Show Gist options
  • Select an option

  • Save mlafeldt/4160812 to your computer and use it in GitHub Desktop.

Select an option

Save mlafeldt/4160812 to your computer and use it in GitHub Desktop.
Add github method to Cheffile (similar to Berkshelf's github shortcut)
# vi: set ft=ruby :
def github(user, repo, protocol = :git)
prefix = {
:git => 'git://github.com/',
:ssh => 'git@github.com:',
:https => 'https://github.com/'
}[protocol]
"#{prefix}#{user}/#{repo}.git"
end
cookbook 'apt', :git => github('opscode-cookbooks', 'apt')
cookbook 'rbenv', :git => github('fnichol', 'chef-rbenv')
cookbook 'ruby_build', :git => github('fnichol', 'chef-ruby_build')
cookbook 'ruby', :git => github('Bigpoint', 'ruby', protocol = :ssh)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment