-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit b6d6cd1
Showing
5 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
sprout-osx-ruby | ||
=============== | ||
Recipes to install ruby related tools on OS X Mountain Lion. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
node.default['sprout']['rbenv'] = { | ||
'home' => "#{node['sprout']['home']}/.rbenv", | ||
'command' => '/usr/local/bin/rbenv', | ||
'rubies' => { | ||
'1.9.3-p448' => {}, | ||
'2.0.0-p247' => {}, | ||
}, | ||
'default_ruby' => '1.9.3-p448', | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
define :ruby_install do | ||
ruby_version = params[:version] || params[:name] | ||
options = params[:options] || {} | ||
|
||
include_recipe "sprout-osx-rbenv" | ||
|
||
rbenv_cmd = node['sprout']['rbenv']['command'] | ||
install_cmd = "#{rbenv_cmd} install #{ruby_version} #{options[:command_line_options]}" | ||
|
||
execute "installing #{ruby_version} with RBENV: #{install_cmd}" do | ||
command install_cmd | ||
user params[:user] || node['current_user'] | ||
only_if params[:only_if] if params[:only_if] | ||
not_if params[:not_if] || "#{rbenv_cmd} versions | grep #{ruby_version}" | ||
env params[:options][:env] | ||
end | ||
|
||
execute "check #{ruby_version}" do | ||
command "#{rbenv_cmd} versions | grep #{ruby_version}" | ||
user params[:user] || node['current_user'] | ||
end | ||
end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name 'sprout-osx-rbenv' | ||
maintainer 'Pivotal Labs' | ||
maintainer_email 'accounts@pivotallabs.com' | ||
license 'MIT' | ||
description 'Installs/Configures sprout-osx-rbenv' | ||
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) | ||
version '0.1.0' | ||
supports 'mac_os_x' | ||
depends 'sprout-osx-base' |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
rubies = node['sprout']['rbenv']['rubies'] | ||
default_ruby = node['sprout']['rbenv']['default_ruby'] | ||
|
||
brew 'rbenv' | ||
brew 'ruby-build' | ||
|
||
sprout_osx_base_bash_it_enable_feature 'plugins/rbenv' | ||
|
||
rubies.each do |version, options| | ||
ruby_install version do | ||
options options | ||
end | ||
end | ||
|
||
execute "making #{default_ruby} with rbenv the default" do | ||
command "rbenv global #{default_ruby}" | ||
user node['current_user'] | ||
not_if { default_ruby.nil? } | ||
end |