forked from vmware-archive/pivotal_workstation
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request vmware-archive#17 from nixterrimus/master
rbenv
- Loading branch information
Showing
4 changed files
with
55 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,8 @@ | ||
node.default["rbenv"]= { | ||
"rubies" => { | ||
"ree-1.8.7-2011.03" => "", | ||
"1.8.7-p352" => "", | ||
"1.9.2-p290" => "" | ||
}, | ||
"default_ruby" => "ree-1.8.7-2011.03" | ||
} |
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,23 @@ | ||
class Chef::Recipe | ||
def rbenv_ruby_install(ruby_version, env_override) | ||
include_recipe "pivotal_workstation::rbenv" | ||
|
||
#don't use the marker file system for this. we guess that people are likely to be installing rubies by hand using rbenv. | ||
#...that guess might be wrong. | ||
unless File.exists?("#{::RBENV_HOME}/#{ruby_version}/bin/ruby") | ||
|
||
install_cmd = "#{env_override} #{RBENV_COMMAND} install #{ruby_version}" | ||
|
||
execute "installing #{ruby_version} with RBENV: #{install_cmd}" do | ||
command install_cmd | ||
user WS_USER | ||
end | ||
|
||
execute "check #{ruby_version}" do | ||
command "#{RBENV_COMMAND} versions | grep #{ruby_version}" | ||
user WS_USER | ||
end | ||
|
||
end | ||
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,22 @@ | ||
include_recipe "pivotal_workstation::bash_profile" | ||
include_recipe "pivotal_workstation::git" | ||
|
||
::RBENV_HOME = "#{WS_HOME}/.rbenv" | ||
::RBENV_COMMAND = "/usr/local/bin/rbenv" | ||
|
||
|
||
brew_install("rbenv") | ||
brew_install("ruby-build") | ||
|
||
bash_profile_include("rbenv") | ||
|
||
node["rbenv"]["rubies"].each do |ruby_version_string, env_override| | ||
rbenv_ruby_install(ruby_version_string,env_override) | ||
end | ||
|
||
if node["rbenv"]["default_ruby"] | ||
execute "making #{node["rbenv"]["default_ruby"]} with rbenv the default" do | ||
command "rbenv global #{node["rbenv"]["default_ruby"]}" | ||
user WS_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,2 @@ | ||
eval "$(rbenv init -)" | ||
export PATH=$PATH:~/.rbenv/shims |