Skip to content

Commit

Permalink
Pass in user to rvm_do(). References #46
Browse files Browse the repository at this point in the history
  • Loading branch information
fnichol committed Oct 15, 2011
1 parent 99a2a30 commit 58c0a03
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libraries/rvm_rubygems_package.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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}}

Expand All @@ -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}}
Expand Down

0 comments on commit 58c0a03

Please sign in to comment.