summaryrefslogtreecommitdiff
path: root/lib/chef/resource
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2019-03-11 16:27:27 -0700
committerTim Smith <tsmith@chef.io>2019-03-11 16:54:50 -0700
commitaf4ba14f511780ce55737aec2d346d0bf1afb962 (patch)
treeac5af9e99a1f87ff1d8d12551c300982ccd8fb0d /lib/chef/resource
parent62c6ff31ea837b2b4c361e413191090fc9e4b4a7 (diff)
downloadchef-af4ba14f511780ce55737aec2d346d0bf1afb962.tar.gz
Add misc YARD commentsyard3
A pile of misc yard I added as I was reading things. Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib/chef/resource')
-rw-r--r--lib/chef/resource/build_essential.rb3
-rw-r--r--lib/chef/resource/chef_gem.rb2
-rw-r--r--lib/chef/resource/chef_handler.rb3
-rw-r--r--lib/chef/resource/execute.rb3
-rw-r--r--lib/chef/resource/homebrew_cask.rb3
-rw-r--r--lib/chef/resource/homebrew_tap.rb3
-rw-r--r--lib/chef/resource/hostname.rb2
-rw-r--r--lib/chef/resource/link.rb5
-rw-r--r--lib/chef/resource/ohai_hint.rb2
9 files changed, 22 insertions, 4 deletions
diff --git a/lib/chef/resource/build_essential.rb b/lib/chef/resource/build_essential.rb
index c10be4b6a1..e9cb656ca6 100644
--- a/lib/chef/resource/build_essential.rb
+++ b/lib/chef/resource/build_essential.rb
@@ -121,7 +121,6 @@ class Chef
# Determine if the XCode Command Line Tools are installed
#
# @return [true, false]
- #
def xcode_cli_installed?
cmd = Mixlib::ShellOut.new("pkgutil --pkgs=com.apple.pkg.CLTools_Executables")
cmd.run_command
@@ -131,6 +130,8 @@ class Chef
end
# this resource forces itself to run at compile_time
+ #
+ # @return [void]
def after_created
return unless compile_time
Array(action).each do |action|
diff --git a/lib/chef/resource/chef_gem.rb b/lib/chef/resource/chef_gem.rb
index 6758a0c753..2079e5d796 100644
--- a/lib/chef/resource/chef_gem.rb
+++ b/lib/chef/resource/chef_gem.rb
@@ -46,6 +46,8 @@ class Chef
default: false, desired_state: false
# force the resource to compile time if the compile time property has been set
+ #
+ # @return [void]
def after_created
if compile_time
Array(action).each do |action|
diff --git a/lib/chef/resource/chef_handler.rb b/lib/chef/resource/chef_handler.rb
index 6d55f882bd..2bac109697 100644
--- a/lib/chef/resource/chef_handler.rb
+++ b/lib/chef/resource/chef_handler.rb
@@ -92,6 +92,8 @@ class Chef
#
# @param handler_type [Symbol] such as :report or :exception.
# @param class_full_name [String] such as 'Chef::Handler::ErrorReport'.
+ #
+ # @return [void]
def unregister_handler(handler_type, class_full_name)
Chef::Config.send("#{handler_type}_handlers").delete_if do |v|
# avoid a bit of log spam
@@ -106,6 +108,7 @@ class Chef
# If the class is not available, NameError is thrown.
#
# @param class_full_name [String] full class name such as 'Chef::Handler::Foo' or 'MyHandler'.
+ #
# @return [Array] parent class and child class.
def get_class(class_full_name)
ancestors = class_full_name.split("::")
diff --git a/lib/chef/resource/execute.rb b/lib/chef/resource/execute.rb
index 3f4b74bd96..afab9a7b27 100644
--- a/lib/chef/resource/execute.rb
+++ b/lib/chef/resource/execute.rb
@@ -116,6 +116,9 @@ class Chef
ancestor_attributes.concat(@class_inherited_attributes ? @class_inherited_attributes : []).uniq
end
+ # post resource creation validation
+ #
+ # @return [void]
def after_created
validate_identity_platform(user, password, domain, elevated)
identity = qualify_user(user, password, domain)
diff --git a/lib/chef/resource/homebrew_cask.rb b/lib/chef/resource/homebrew_cask.rb
index 264ad72587..1f5a9afa81 100644
--- a/lib/chef/resource/homebrew_cask.rb
+++ b/lib/chef/resource/homebrew_cask.rb
@@ -87,6 +87,9 @@ class Chef
alias_method :action_uncask, :action_remove
alias_method :action_uninstall, :action_remove
+ # Is the desired cask already casked?
+ #
+ # @return [Boolean]
def casked?
unscoped_name = new_resource.cask_name.split("/").last
shell_out!("#{new_resource.homebrew_path} cask list 2>/dev/null",
diff --git a/lib/chef/resource/homebrew_tap.rb b/lib/chef/resource/homebrew_tap.rb
index 9d880c565f..bbcc0b1463 100644
--- a/lib/chef/resource/homebrew_tap.rb
+++ b/lib/chef/resource/homebrew_tap.rb
@@ -78,6 +78,9 @@ class Chef
end
end
+ # Is the passed tap already tapped
+ #
+ # @return [Boolean]
def tapped?(name)
tap_dir = name.gsub("/", "/homebrew-")
::File.directory?("/usr/local/Homebrew/Library/Taps/#{tap_dir}")
diff --git a/lib/chef/resource/hostname.rb b/lib/chef/resource/hostname.rb
index 6b5a5617cf..d0bf9b9a4b 100644
--- a/lib/chef/resource/hostname.rb
+++ b/lib/chef/resource/hostname.rb
@@ -253,6 +253,8 @@ class Chef
end
# this resource forces itself to run at compile_time
+ #
+ # @return [void]
def after_created
if compile_time
Array(action).each do |action|
diff --git a/lib/chef/resource/link.rb b/lib/chef/resource/link.rb
index f62209108c..adb8e10533 100644
--- a/lib/chef/resource/link.rb
+++ b/lib/chef/resource/link.rb
@@ -74,10 +74,9 @@ class Chef
private
+ # On certain versions of windows links are not supported. Make
+ # sure we are not on such a platform.
def verify_links_supported!
- # On certain versions of windows links are not supported. Make
- # sure we are not on such a platform.
-
if Chef::Platform.windows?
require "chef/win32/file"
begin
diff --git a/lib/chef/resource/ohai_hint.rb b/lib/chef/resource/ohai_hint.rb
index 0a710a166c..e8de5f602a 100644
--- a/lib/chef/resource/ohai_hint.rb
+++ b/lib/chef/resource/ohai_hint.rb
@@ -84,6 +84,8 @@ class Chef
end
# this resource forces itself to run at compile_time
+ #
+ # @return [void]
def after_created
return unless compile_time
Array(action).each do |action|