summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrajaktaPurohit <prajakta@opscode.com>2012-08-16 08:23:20 -0700
committerPrajaktaPurohit <prajakta@opscode.com>2012-08-23 14:09:04 -0700
commit12fc9befe7e7ff8fc1365c5110e139640f92e953 (patch)
treeaa01db8ba66d3fa92bc9c9d25fdfdd58199fdbd1
parent637ad90b003c29176507250160e0c677da5008a1 (diff)
downloadchef-12fc9befe7e7ff8fc1365c5110e139640f92e953.tar.gz
CHEF-3276:Fixed rubygems provider to issue a warning if options are passed as hash instead of string && using the omnibus installer && gem binary is specified.
-rw-r--r--chef/lib/chef/provider/package/rubygems.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/chef/lib/chef/provider/package/rubygems.rb b/chef/lib/chef/provider/package/rubygems.rb
index acefdc321d..e60d73ab62 100644
--- a/chef/lib/chef/provider/package/rubygems.rb
+++ b/chef/lib/chef/provider/package/rubygems.rb
@@ -345,6 +345,11 @@ class Chef
elsif is_omnibus? && (!@new_resource.instance_of? Chef::Resource::ChefGem)
# Opscode Omnibus - The ruby that ships inside omnibus is only used for Chef
# Default to installing somewhere more functional
+ if new_resource.options && new_resource.options.kind_of?(Hash)
+ msg = "options should be a string instead of a hash\n"
+ msg << "in #{new_resource} from #{new_resource.source_line}"
+ raise ArgumentError, msg
+ end
gem_location = find_gem_by_path
@new_resource.gem_binary gem_location
@gem_env = AlternateGemEnvironment.new(gem_location)