Skip to content

Commit

Permalink
Add user attr on all resources.
Browse files Browse the repository at this point in the history
  • Loading branch information
fnichol committed Aug 9, 2011
1 parent b434934 commit ab05430
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion providers/default_ruby.rb
Expand Up @@ -26,7 +26,7 @@ def load_current_resource
@rubie = normalize_ruby_string(select_ruby(new_resource.ruby_string))
@gemset = select_gemset(new_resource.ruby_string)
@ruby_string = @gemset.nil? ? @rubie : "#{@rubie}@#{@gemset}"
@rvm_env = ::RVM::ChefUserEnvironment.new()
@rvm_env = ::RVM::ChefUserEnvironment.new(new_resource.user)
end

action :create do
Expand Down
2 changes: 1 addition & 1 deletion providers/environment.rb
Expand Up @@ -27,7 +27,7 @@ def load_current_resource
@rubie = normalize_ruby_string(select_ruby(new_resource.ruby_string))
@gemset = select_gemset(new_resource.ruby_string)
@ruby_string = @gemset.nil? ? @rubie : "#{@rubie}@#{@gemset}"
@rvm_env = ::RVM::ChefUserEnvironment.new()
@rvm_env = ::RVM::ChefUserEnvironment.new(new_resource.user)
end

action :create do
Expand Down
2 changes: 1 addition & 1 deletion providers/gemset.rb
Expand Up @@ -32,7 +32,7 @@ def load_current_resource
@gemset = select_gemset(new_resource.gemset)
end
@ruby_string = "#{@rubie}@#{@gemset}"
@rvm_env = ::RVM::ChefUserEnvironment.new()
@rvm_env = ::RVM::ChefUserEnvironment.new(new_resource.user)
end

action :create do
Expand Down
2 changes: 1 addition & 1 deletion providers/global_gem.rb
Expand Up @@ -22,7 +22,7 @@
include Chef::RVM::RubyHelpers

def load_current_resource
@rvm_env = ::RVM::ChefUserEnvironment.new()
@rvm_env = ::RVM::ChefUserEnvironment.new(new_resource.user)
end

action :install do
Expand Down
2 changes: 1 addition & 1 deletion providers/ruby.rb
Expand Up @@ -25,7 +25,7 @@
def load_current_resource
@rubie = normalize_ruby_string(select_ruby(new_resource.ruby_string))
@ruby_string = @rubie
@rvm_env = ::RVM::ChefUserEnvironment.new()
@rvm_env = ::RVM::ChefUserEnvironment.new(new_resource.user)
end

action :install do
Expand Down
2 changes: 1 addition & 1 deletion providers/shell.rb
Expand Up @@ -27,7 +27,7 @@ def load_current_resource
@rubie = normalize_ruby_string(select_ruby(new_resource.ruby_string))
@gemset = select_gemset(new_resource.ruby_string)
@ruby_string = @gemset.nil? ? @rubie : "#{@rubie}@#{@gemset}"
@rvm_env = ::RVM::ChefUserEnvironment.new()
@rvm_env = ::RVM::ChefUserEnvironment.new(new_resource.user)
end

action :run do
Expand Down
2 changes: 1 addition & 1 deletion providers/wrapper.rb
Expand Up @@ -26,7 +26,7 @@ def load_current_resource
@rubie = normalize_ruby_string(select_ruby(new_resource.ruby_string))
@gemset = select_gemset(new_resource.ruby_string)
@ruby_string = @gemset.nil? ? @rubie : "#{@rubie}@#{@gemset}"
@rvm_env = ::RVM::ChefUserEnvironment.new()
@rvm_env = ::RVM::ChefUserEnvironment.new(new_resource.user)

if new_resource.binary.nil?
@binaries = new_resource.binaries || []
Expand Down
1 change: 1 addition & 0 deletions resources/default_ruby.rb
Expand Up @@ -22,6 +22,7 @@
actions :create

attribute :ruby_string, :kind_of => String, :name_attribute => true
attribute :user, :kind_of => String

def initialize(*args)
super
Expand Down
1 change: 1 addition & 0 deletions resources/environment.rb
Expand Up @@ -22,6 +22,7 @@
actions :create

attribute :ruby_string, :kind_of => String, :name_attribute => true
attribute :user, :kind_of => String

def initialize(*args)
super
Expand Down
1 change: 1 addition & 0 deletions resources/gem.rb
Expand Up @@ -28,6 +28,7 @@
attribute :source, :kind_of => String
attribute :options, :kind_of => Hash
attribute :gem_binary, :kind_of => String
attribute :user, :kind_of => String

def initialize(*args)
super
Expand Down
1 change: 1 addition & 0 deletions resources/gemset.rb
Expand Up @@ -23,6 +23,7 @@

attribute :gemset, :kind_of => String, :name_attribute => true
attribute :ruby_string, :kind_of => String, :regex => /^[^@]+$/
attribute :user, :kind_of => String

def initialize(*args)
super
Expand Down
1 change: 1 addition & 0 deletions resources/global_gem.rb
Expand Up @@ -26,6 +26,7 @@
attribute :source, :kind_of => String
attribute :options, :kind_of => Hash
attribute :gem_binary, :kind_of => String
attribute :user, :kind_of => String

def initialize(*args)
super
Expand Down
1 change: 1 addition & 0 deletions resources/ruby.rb
Expand Up @@ -22,6 +22,7 @@
actions :install, :uninstall, :remove

attribute :ruby_string, :kind_of => String, :name_attribute => true
attribute :user, :kind_of => String

def initialize(*args)
super
Expand Down
1 change: 1 addition & 0 deletions resources/wrapper.rb
Expand Up @@ -25,6 +25,7 @@
attribute :ruby_string, :kind_of => String
attribute :binary, :kind_of => String
attribute :binaries, :kind_of => Array
attribute :user, :kind_of => String

def initialize(*args)
super
Expand Down

0 comments on commit ab05430

Please sign in to comment.