From e4e3c1ebac59f6ff3dc92c0cef7a7ef5f9e76cb7 Mon Sep 17 00:00:00 2001 From: "Michael H. Oshita" Date: Wed, 19 Jun 2013 17:35:31 +0900 Subject: [PATCH] added rbenv sudo plugin --- README.md | 6 ++++++ attributes/default.rb | 3 +++ recipes/rbenv_sudo.rb | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 recipes/rbenv_sudo.rb diff --git a/README.md b/README.md index b77fb26..ba087bc 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,12 @@ To install rbenv-vars; Include this recipe in one of your cookbook's recipes include_recipe "rbenv::rbenv_vars" +## Installing rbenv-sudo + +To install rbenv-sudo; Include this recipe in one of your cookbook's recipes + + include_recipe "rbenv::rbenv_sudo" + ## Installing a Ruby And now to install a Ruby use the `rbenv_ruby` LWRP diff --git a/attributes/default.rb b/attributes/default.rb index 51be2de..d9e0767 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_sudo][:git_repository] = "https://github.com/dcarley/rbenv-sudo.git" +default[:rbenv_sudo][:git_revision] = "master" diff --git a/recipes/rbenv_sudo.rb b/recipes/rbenv_sudo.rb new file mode 100644 index 0000000..c2f3ac0 --- /dev/null +++ b/recipes/rbenv_sudo.rb @@ -0,0 +1,34 @@ +# +# Cookbook Name:: rbenv +# Recipe:: rbenv_sudo +# +# Author:: Michael H. Oshita () +# +# 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-sudo" + +with_home_for_user(node[:rbenv][:user]) do + + git plugin_path do + repository node[:rbenv_sudo][:git_repository] + reference node[:rbenv_sudo][:git_revision] + action :sync + user node[:rbenv][:user] + group node[:rbenv][:group] + end + +end