summaryrefslogtreecommitdiff
path: root/lib/chef/resource/chef_gem.rb
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-04-22 16:09:51 -0700
committerTim Smith <tsmith84@gmail.com>2020-04-22 21:55:48 -0700
commit6ed90220893285f80513c6155620ebd0d2fbda1e (patch)
treebc80135e28c495d8353820ef7ea7a372c77c1bf5 /lib/chef/resource/chef_gem.rb
parent27b54f893cb1c48250dcc4e008bc602e8f819dd5 (diff)
downloadchef-6ed90220893285f80513c6155620ebd0d2fbda1e.tar.gz
Make sure all the non-multipackage packge resources can't take arrayspackage
Right now these resources inherit package_name, versions, and options from the package resource which allows arrays. The problem is the actual providers for these package resources don't know what to do with arrays and they explode. They explode in ways that are really unfriendly to users. With this change they'll get a nice input validation error and they'll have a lot more of an idea of how to go about resolving the problem. This also means that our automatically generated documentation for the package resources will be correct since right now it documents everything as accepting an array. Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib/chef/resource/chef_gem.rb')
-rw-r--r--lib/chef/resource/chef_gem.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/chef/resource/chef_gem.rb b/lib/chef/resource/chef_gem.rb
index 2d6613b771..bee7c265b0 100644
--- a/lib/chef/resource/chef_gem.rb
+++ b/lib/chef/resource/chef_gem.rb
@@ -38,6 +38,13 @@ class Chef
unified_mode true
provides :chef_gem
+ property :package_name, String,
+ description: "An optional property to set the package name if it differs from the resource block's name.",
+ identity: true
+
+ property :version, String,
+ description: "The version of a package to be installed or upgraded."
+
property :gem_binary, default: "#{RbConfig::CONFIG["bindir"]}/gem", default_description: "Chef's built-in gem binary.",
description: "The path of a gem binary to use for the installation. By default, the same version of Ruby that is used by the #{Chef::Dist::CLIENT} will be installed.",
callbacks: {