diff --git a/README.md b/README.md index 0c5339a9..9d8050c0 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,8 @@ built as a pre-requisite. The value can also contain a gemset in the form of **Note:** a fully qualified RVM string name needs to be used, which can be found when running `rvm list known`. -The default is `ruby-1.9.2-p180`. To disable a ruby form being installed, set this -attribute to `nil`. +The default is `ruby-1.9.2-p180`. To disable a default ruby from being +installed, see the `install_rubies` attribute. ## `rubies` @@ -39,7 +39,18 @@ care of installing itself. For example: **Note:** a fully qualified RVM string name needs to be used, which can be found when running `rvm list known`. -The default is an empty array. +The default is an empty array. To disable a default ruby from being +installed, see the `install_rubies` attribute. + +## `install_rubies` + +Can enable or disable installation of a default ruby and additional rubies set +attribute metadata. The primary use case for this attribute is when you don't +want any rubies installed (but you want RVM installed). To do so: + + node[:rvm][:install_rubies] = "disable" + +The default is `enable`. ## `global_gems` diff --git a/attributes/default.rb b/attributes/default.rb index 0421d24e..35fb0747 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -30,6 +30,9 @@ default[:rvm][:upgrade] = "none" +# a hook to disable installing any default/additional rubies +default[:rvm][:install_rubies] = "enable" + # ruby that will get installed and set to `rvm use default`. default[:rvm][:default_ruby] = "ruby-1.9.2-p180" diff --git a/recipes/default.rb b/recipes/default.rb index fdbd3434..bb03ac12 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -36,14 +36,14 @@ include_recipe "rvm::system" -# set a default ruby -unless node[:rvm][:default_ruby].nil? +if node[:rvm][:install_rubies] == "enable" + # set a default ruby rvm_default_ruby node[:rvm][:default_ruby] -end -# install additional rubies -node[:rvm][:rubies].each do |rubie| - rvm_ruby rubie + # install additional rubies + node[:rvm][:rubies].each do |rubie| + rvm_ruby rubie + end end # install global gems