diff options
author | Tim Smith <tsmith84@gmail.com> | 2020-05-01 14:09:06 -0700 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2020-05-01 14:09:06 -0700 |
commit | 4acaf1161cc2cbae4bd2a77d0e0e52594a972fae (patch) | |
tree | df0032fa937b36c2d9c59eee8fa336e67276f00a | |
parent | 61208f0ca367a155ca2e4ab3e0b8070442b62cfa (diff) | |
download | chef-4acaf1161cc2cbae4bd2a77d0e0e52594a972fae.tar.gz |
Improve descriptions and add a missing resource require
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r-- | lib/chef/resource/chef_gem.rb | 6 | ||||
-rw-r--r-- | lib/chef/resource/gem_package.rb | 8 |
2 files changed, 9 insertions, 5 deletions
diff --git a/lib/chef/resource/chef_gem.rb b/lib/chef/resource/chef_gem.rb index bee7c265b0..292fcbd55e 100644 --- a/lib/chef/resource/chef_gem.rb +++ b/lib/chef/resource/chef_gem.rb @@ -34,6 +34,10 @@ class Chef # installed # - Runs Gem.clear_paths after the action, ensuring that gem is aware of changes so that it can be required # immediately after it is installed + + require_relative "gem_package" + require_relative "../dist" + class ChefGem < Chef::Resource::Package::GemPackage unified_mode true provides :chef_gem @@ -45,7 +49,7 @@ class Chef 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.", + property :gem_binary, default: "#{RbConfig::CONFIG["bindir"]}/gem", default_description: "The `gem` binary included with #{Chef::Dist::PRODUCT}.", 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: { "The chef_gem resource is restricted to the current gem environment, use gem_package to install to other environments." => proc { |v| v == "#{RbConfig::CONFIG["bindir"]}/gem" }, diff --git a/lib/chef/resource/gem_package.rb b/lib/chef/resource/gem_package.rb index 96da7fd513..9c021dea1b 100644 --- a/lib/chef/resource/gem_package.rb +++ b/lib/chef/resource/gem_package.rb @@ -46,21 +46,21 @@ class Chef # FIXME? the array form of installing paths most likely does not work? # property :source, [ String, Array ], - description: "Optional. The URL, or list of URLs, at which the gem package is located. This list is added to the source configured in Chef::Config[:rubygems_url] (see also include_default_source) to construct the complete list of rubygems sources. Users in an 'airgapped' environment should set Chef::Config[:rubygems_url] to their local RubyGems mirror." + description: "Optional. The URL, or list of URLs, at which the gem package is located. This list is added to the source configured in `Chef::Config[:rubygems_url]` (see also include_default_source) to construct the complete list of rubygems sources. Users in an 'airgapped' environment should set Chef::Config[:rubygems_url] to their local RubyGems mirror." property :clear_sources, [ TrueClass, FalseClass, nil ], - description: "Set to 'true' to download a gem from the path specified by the `source` property (and not from RubyGems).", + description: "Set to `true` to download a gem from the path specified by the `source` property (and not from RubyGems).", default: lazy { Chef::Config[:clear_gem_sources] }, desired_state: false property :gem_binary, String, desired_state: false, 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." property :include_default_source, [ TrueClass, FalseClass, nil ], - description: "Set to 'false' to not include 'Chef::Config[:rubygems_url]'' in the sources.", + description: "Set to `false` to not include `Chef::Config[:rubygems_url]` in the sources.", default: nil, introduced: "13.0" property :options, [ String, Hash, Array, nil ], - description: "Options for the gem install, either a Hash or a String. When a hash is given, the options are passed to Gem::DependencyInstaller.new, and the gem will be installed via the gems API. When a String is given, the gem will be installed by shelling out to the gem command. Using a Hash of options with an explicit gem_binary will result in undefined behavior.", + description: "Options for the gem install, either a Hash or a String. When a hash is given, the options are passed to `Gem::DependencyInstaller.new`, and the gem will be installed via the gems API. When a String is given, the gem will be installed by shelling out to the gem command. Using a Hash of options with an explicit gem_binary will result in undefined behavior.", desired_state: false end end |