Permalink
Browse files

Add rubygems_version attribute to rvm_ruby resource

This currently affects only the initial installation of the ruby.
  • Loading branch information...
cgriego committed Apr 26, 2012
1 parent e23a452 commit dd1ef22f2c3fe428c323532deca7569b0fb2bacd
Showing with 18 additions and 12 deletions.
  1. +7 −5 README.md
  2. +6 −3 libraries/chef_rvm_recipe_helpers.rb
  3. +1 −1 providers/ruby.rb
  4. +4 −3 resources/ruby.rb
View
@@ -245,14 +245,15 @@ set, use an empty string (`""`) or a value of `"system"`.
A list of additional RVM system-wide Rubies to be built and installed. This
list does not need to necessarily contain your default Ruby as the
`rvm_default_ruby` resource will take care of installing itself. You may also
-include patch info. For example:
+include patch info and a rubygems version. For example:
node['rvm']['rubies'] = [
"ree-1.8.7",
"jruby",
{
- :version => '1.9.3-p125-perf',
- :patch => "falcon"
+ 'version' => '1.9.3-p125-perf',
+ 'patch' => 'falcon',
+ 'rubygems_version' => '1.5.2'
}
]
@@ -375,8 +376,9 @@ The hash keys correspond to the default/system equivalents. For example:
"ree-1.8.7",
"jruby",
{
- :version => '1.9.3-p125-perf',
- :patch => "falcon"
+ 'version' => '1.9.3-p125-perf',
+ 'patch' => "falcon",
+ 'rubygems_version' => '1.5.2'
}
],
'rvmrc' => {
@@ -155,15 +155,18 @@ def install_rubies(opts = {})
opts[:rubies].each do |rubie|
if rubie.is_a?(Hash)
ruby = rubie.fetch("version")
- ruby_patch = rubie.fetch("patch")
+ ruby_patch = rubie.fetch("patch", nil)
+ ruby_rubygems_version = rubie.fetch("rubygems_version", nil)
else
ruby = rubie
ruby_patch = nil
+ ruby_rubygems_version = nil
end
rvm_ruby ruby do
- patch ruby_patch
- user opts[:user]
+ patch ruby_patch
+ user opts[:user]
+ rubygems_version ruby_rubygems_version
end
end
View
@@ -25,7 +25,7 @@
def load_current_resource
@rubie = normalize_ruby_string(select_ruby(new_resource.ruby_string))
@ruby_string = new_resource.ruby_string
- @rvm_env = ::RVM::ChefUserEnvironment.new(new_resource.user)
+ @rvm_env = ::RVM::ChefUserEnvironment.new(new_resource.user, "default", :rvm_rubygems_version => new_resource.rubygems_version)
end
action :install do
View
@@ -21,9 +21,10 @@
actions :install, :uninstall, :remove
-attribute :ruby_string, :kind_of => String, :name_attribute => true
-attribute :user, :kind_of => String
-attribute :patch, :kind_of => String
+attribute :ruby_string, :kind_of => String, :name_attribute => true
+attribute :user, :kind_of => String
+attribute :patch, :kind_of => String
+attribute :rubygems_version, :kind_of => String
def initialize(*args)
super

0 comments on commit dd1ef22

Please sign in to comment.