diff --git a/README.md b/README.md index 5aed2da..c77cee9 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,12 @@ To install rbenv and ruby_build; Include each recipe in one of your cookbook's r To install rbenv-vars; Include this recipe in one of your cookbook's recipes include_recipe "rbenv::rbenv_vars" + +## Installing rbenv-binstubs + +To install rbenv-binstubs; Include this recipe in one of your cookbook's recipes + + include_recipe "rbenv::rbenv_binstubs" ## Installing a Ruby @@ -61,6 +67,11 @@ Be sure to include a value for the `ruby_version` attribute so the gem is instal * `ruby_build[:git_revision]` - Revision of the ruby_build repository to checkout * `ruby_build[:prefix]` - Path prefix where ruby_build will be installed to +## rbenv_binstubs + +* `rbenv_binstubs[:git_repository]` - Git url of the rbenv-binstubs repository to clone +* `rbenv_binstubs[:git_revision]` - Revision of the rbenv-binstubs repository to checkout + # Recipes ## default @@ -71,6 +82,10 @@ Configures a node with a system wide rbenv accessible by users in the rbenv grou Installs ruby_build to a node which enables the `rbenv_ruby` LWRP to install Rubies to the node +## rbenv_binstubs + +Installs rbenv-binstubs + ## ohai_plugin Installs an rbenv Ohai plugin onto the node to automatically populate attributes about the rbenv installation diff --git a/attributes/default.rb b/attributes/default.rb index 51be2de..f158c7a 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -34,3 +34,6 @@ default[:rbenv_vars][:git_repository] = "https://github.com/sstephenson/rbenv-vars.git" default[:rbenv_vars][:git_revision] = "master" + +default[:rbenv_binstubs][:git_repository] = "https://github.com/ianheggie/rbenv-binstubs.git" +default[:rbenv_binstubs][:git_revision] = "master" diff --git a/recipes/rbenv_binstubs.rb b/recipes/rbenv_binstubs.rb new file mode 100644 index 0000000..7cc7b75 --- /dev/null +++ b/recipes/rbenv_binstubs.rb @@ -0,0 +1,36 @@ +# +# Cookbook Name:: rbenv +# Recipe:: rbenv_binstubs +# +# Author:: David Chamard () +# +# Copyright 2011-2012, Riot Games +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +include_recipe "git" + +plugin_path = "#{node[:rbenv][:root]}/plugins/rbenv-binstubs" + +with_home_for_user(node[:rbenv][:user]) do + + git plugin_path do + repository node[:rbenv_binstubs][:git_repository] + reference node[:rbenv_binstubs][:git_revision] + action :sync + user node[:rbenv][:user] + group node[:rbenv][:group] + end + +end