From 58c0a03f2578d5c0141c6f49668e8c145fca39d0 Mon Sep 17 00:00:00 2001 From: Fletcher Nichol Date: Sat, 15 Oct 2011 12:37:53 -0600 Subject: [PATCH] Pass in user to rvm_do(). References #46 --- libraries/rvm_rubygems_package.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/rvm_rubygems_package.rb b/libraries/rvm_rubygems_package.rb index a8ba5977..3bd868b6 100644 --- a/libraries/rvm_rubygems_package.rb +++ b/libraries/rvm_rubygems_package.rb @@ -49,7 +49,7 @@ def initialize(gem_binary_location, ruby_strings, user = nil) def gem_paths cmd = "rvm #{ruby_strings.join(',')} " - cmd << "#{rvm_do} #{@gem_binary_location} env gempath" + cmd << "#{rvm_do(user)} #{@gem_binary_location} env gempath" if user user_dir = Etc.getpwnam(user).dir @@ -69,7 +69,7 @@ def gem_paths def gem_platforms cmd = "rvm #{ruby_strings.join(',')} " - cmd << "#{rvm_do} #{@gem_binary_location} env" + cmd << "#{rvm_do(user)} #{@gem_binary_location} env" if user user_dir = Etc.getpwnam(user).dir @@ -139,7 +139,7 @@ def install_via_gem_command(name, version) src = @new_resource.source && " --source=#{@new_resource.source} --source=http://rubygems.org" - cmd = %{rvm #{ruby_strings.join(',')} #{rvm_do} #{gem_binary_path}} + cmd = %{rvm #{ruby_strings.join(',')} #{rvm_do(new_resource.user)} #{gem_binary_path}} cmd << %{ install #{name} -q --no-rdoc --no-ri -v "#{version}"} cmd << %{#{src}#{opts}} @@ -159,7 +159,7 @@ def remove_package(name, version) end def uninstall_via_gem_command(name, version) - cmd = %{rvm #{ruby_strings.join(',')} #{rvm_do} #{gem_binary_path}} + cmd = %{rvm #{ruby_strings.join(',')} #{rvm_do(new_resource.user)} #{gem_binary_path}} cmd << %{ uninstall #{name} -q -x -I} if version cmd << %{ -v "#{version}"#{opts}}