summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2020-02-03 16:31:14 -0800
committerGitHub <noreply@github.com>2020-02-03 16:31:14 -0800
commit748c781304c6c115d46337692b75084f26fc410d (patch)
treee584f70864e9bdd8c26444a928f174ae8a630918
parentaa0297ae932ae6eac9e940f22b5c8ced62b9322a (diff)
parent7b4df01ce43f097bee6560ffb19b1e43806418a2 (diff)
downloadchef-748c781304c6c115d46337692b75084f26fc410d.tar.gz
Merge pull request #9326 from chef/chef_utils_yard
Expand the chef-utils yard for better vscode plugin generation
-rw-r--r--chef-utils/lib/chef-utils/dsl/architecture.rb38
-rw-r--r--chef-utils/lib/chef-utils/dsl/cloud.rb50
-rw-r--r--chef-utils/lib/chef-utils/dsl/introspection.rb15
-rw-r--r--chef-utils/lib/chef-utils/dsl/os.rb10
-rw-r--r--chef-utils/lib/chef-utils/dsl/path_sanity.rb1
-rw-r--r--chef-utils/lib/chef-utils/dsl/platform.rb84
-rw-r--r--chef-utils/lib/chef-utils/dsl/platform_family.rb92
-rw-r--r--chef-utils/lib/chef-utils/dsl/service.rb10
-rw-r--r--chef-utils/lib/chef-utils/dsl/train_helpers.rb4
-rw-r--r--chef-utils/lib/chef-utils/dsl/windows.rb21
10 files changed, 217 insertions, 108 deletions
diff --git a/chef-utils/lib/chef-utils/dsl/architecture.rb b/chef-utils/lib/chef-utils/dsl/architecture.rb
index ec1d8424b1..d20c6c5a76 100644
--- a/chef-utils/lib/chef-utils/dsl/architecture.rb
+++ b/chef-utils/lib/chef-utils/dsl/architecture.rb
@@ -22,7 +22,9 @@ module ChefUtils
module Architecture
include Internal
- # Determine if the current architecture is 64-bit
+ # Determine if the current architecture is 64-bit.
+ #
+ # @since 15.5
#
# @return [Boolean]
#
@@ -31,7 +33,9 @@ module ChefUtils
.include?(node["kernel"]["machine"])
end
- # Determine if the current architecture is 32-bit
+ # Determine if the current architecture is 32-bit.
+ #
+ # @since 15.5
#
# @return [Boolean]
#
@@ -39,7 +43,9 @@ module ChefUtils
!_64_bit?(node)
end
- # Determine if the current architecture is i386
+ # Determine if the current architecture is i386.
+ #
+ # @since 15.5
#
# @return [Boolean]
#
@@ -49,6 +55,8 @@ module ChefUtils
# Determine if the current architecture is Intel.
#
+ # @since 15.5
+ #
# @return [Boolean]
#
def intel?(node = __getnode)
@@ -57,13 +65,17 @@ module ChefUtils
# Determine if the current architecture is SPARC.
#
+ # @since 15.5
+ #
# @return [Boolean]
#
def sparc?(node = __getnode)
%w{sun4u sun4v}.include?(node["kernel"]["machine"])
end
- # Determine if the current architecture is PowerPC 64bit Big Endian
+ # Determine if the current architecture is PowerPC 64bit Big Endian.
+ #
+ # @since 15.5
#
# @return [Boolean]
#
@@ -71,7 +83,9 @@ module ChefUtils
%w{ppc64}.include?(node["kernel"]["machine"])
end
- # Determine if the current architecture is PowerPC 64bit Little Endian
+ # Determine if the current architecture is PowerPC 64bit Little Endian.
+ #
+ # @since 15.5
#
# @return [Boolean]
#
@@ -81,13 +95,17 @@ module ChefUtils
# Determine if the current architecture is PowerPC.
#
+ # @since 15.5
+ #
# @return [Boolean]
#
def powerpc?(node = __getnode)
%w{powerpc}.include?(node["kernel"]["machine"])
end
- # Determine if the current architecture is 32-bit ARM
+ # Determine if the current architecture is 32-bit ARM.
+ #
+ # @since 15.5
#
# @return [Boolean]
#
@@ -95,7 +113,9 @@ module ChefUtils
%w{armhf}.include?(node["kernel"]["machine"])
end
- # Determine if the current architecture is s390x
+ # Determine if the current architecture is s390x.
+ #
+ # @since 15.5
#
# @return [Boolean]
#
@@ -103,7 +123,9 @@ module ChefUtils
%w{s390x}.include?(node["kernel"]["machine"])
end
- # Determine if the current architecture is s390
+ # Determine if the current architecture is s390.
+ #
+ # @since 15.5
#
# @return [Boolean]
#
diff --git a/chef-utils/lib/chef-utils/dsl/cloud.rb b/chef-utils/lib/chef-utils/dsl/cloud.rb
index 6aba9d1b51..32911609cc 100644
--- a/chef-utils/lib/chef-utils/dsl/cloud.rb
+++ b/chef-utils/lib/chef-utils/dsl/cloud.rb
@@ -24,7 +24,8 @@ module ChefUtils
# Determine if the current node is "in the cloud".
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.8
#
# @return [Boolean]
#
@@ -32,9 +33,10 @@ module ChefUtils
node.key?("cloud")
end
- # Return true if the current current node is in EC2
+ # Return true if the current current node is in EC2.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.8
#
# @return [Boolean]
#
@@ -42,9 +44,10 @@ module ChefUtils
node.key?("ec2")
end
- # Return true if the current current node is in GCE
+ # Return true if the current current node is in GCE.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.8
#
# @return [Boolean]
#
@@ -52,9 +55,10 @@ module ChefUtils
node.key?("gce")
end
- # Return true if the current current node is in Rackspace
+ # Return true if the current current node is in Rackspace.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.8
#
# @return [Boolean]
#
@@ -62,9 +66,10 @@ module ChefUtils
node.key?("rackspace")
end
- # Return true if the current current node is in Eucalyptus
+ # Return true if the current current node is in Eucalyptus.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.8
#
# @return [Boolean]
#
@@ -73,9 +78,10 @@ module ChefUtils
end
alias_method :euca?, :eucalyptus?
- # Return true if the current current node is in Linode
+ # Return true if the current current node is in Linode.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.8
#
# @return [Boolean]
#
@@ -83,9 +89,10 @@ module ChefUtils
node.key?("linode")
end
- # Return true if the current current node is in Openstack
+ # Return true if the current current node is in OpenStack.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.8
#
# @return [Boolean]
#
@@ -93,9 +100,10 @@ module ChefUtils
node.key?("openstack")
end
- # Return true if the current current node is in Azure
+ # Return true if the current current node is in Azure.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.8
#
# @return [Boolean]
#
@@ -103,10 +111,10 @@ module ChefUtils
node.key?("azure")
end
- # Return true if the current current node is in DigitalOcean
+ # Return true if the current current node is in DigitalOcean.
#
- # @param [Chef::Node] node
- # the node to check
+ # @param [Chef::Node] node the node to check
+ # @since 15.8
#
# @return [Boolean]
#
@@ -115,10 +123,10 @@ module ChefUtils
end
alias_method :digitalocean?, :digital_ocean?
- # Return true if the current current node is in SoftLayer
+ # Return true if the current current node is in SoftLayer.
#
- # @param [Chef::Node] node
- # the node to check
+ # @param [Chef::Node] node the node to check
+ # @since 15.8
#
# @return [Boolean]
#
diff --git a/chef-utils/lib/chef-utils/dsl/introspection.rb b/chef-utils/lib/chef-utils/dsl/introspection.rb
index c5dcdc0c20..07c77aa3a8 100644
--- a/chef-utils/lib/chef-utils/dsl/introspection.rb
+++ b/chef-utils/lib/chef-utils/dsl/introspection.rb
@@ -30,7 +30,8 @@ module ChefUtils
# Determine if the node is a docker container.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -42,7 +43,8 @@ module ChefUtils
# Determine if the node uses the systemd init system.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -52,7 +54,8 @@ module ChefUtils
# Determine if the node is running in Test Kitchen.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -62,7 +65,8 @@ module ChefUtils
# Determine if the node is running in a CI system that sets the CI env var.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -73,6 +77,7 @@ module ChefUtils
# Determine if the a systemd service unit is present on the system.
#
# @param [String] svc_name
+ # @since 15.5
#
# @return [Boolean]
#
@@ -87,6 +92,7 @@ module ChefUtils
# Determine if the a systemd unit of any type is present on the system.
#
# @param [String] svc_name
+ # @since 15.5
#
# @return [Boolean]
#
@@ -100,6 +106,7 @@ module ChefUtils
# Determine if the current node includes the given recipe name.
#
# @param [String] recipe_name
+ # @since 15.8
#
# @return [Boolean]
#
diff --git a/chef-utils/lib/chef-utils/dsl/os.rb b/chef-utils/lib/chef-utils/dsl/os.rb
index 6d1d749957..800753c054 100644
--- a/chef-utils/lib/chef-utils/dsl/os.rb
+++ b/chef-utils/lib/chef-utils/dsl/os.rb
@@ -29,9 +29,10 @@ module ChefUtils
# only the platform helper should be added.
#
- # Determine if the current node is linux.
+ # Determine if the current node is Linux.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -39,9 +40,10 @@ module ChefUtils
node["os"] == "linux"
end
- # Determine if the current node is darwin.
+ # Determine if the current node is Darwin.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
diff --git a/chef-utils/lib/chef-utils/dsl/path_sanity.rb b/chef-utils/lib/chef-utils/dsl/path_sanity.rb
index ec8d84922e..8eb4c90068 100644
--- a/chef-utils/lib/chef-utils/dsl/path_sanity.rb
+++ b/chef-utils/lib/chef-utils/dsl/path_sanity.rb
@@ -23,6 +23,7 @@ module ChefUtils
module PathSanity
include Internal
+ # @since 15.5
def sanitized_path(env = nil)
env_path = env ? env["PATH"] : __env_path
env_path = "" if env_path.nil?
diff --git a/chef-utils/lib/chef-utils/dsl/platform.rb b/chef-utils/lib/chef-utils/dsl/platform.rb
index 29f6b1563c..80406167f0 100644
--- a/chef-utils/lib/chef-utils/dsl/platform.rb
+++ b/chef-utils/lib/chef-utils/dsl/platform.rb
@@ -29,7 +29,8 @@ module ChefUtils
# Determine if the current node is linux mint.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -43,7 +44,8 @@ module ChefUtils
# Determine if the current node is ubuntu.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -54,7 +56,8 @@ module ChefUtils
# Determine if the current node is raspbian.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -65,7 +68,8 @@ module ChefUtils
# Determine if the current node is debian.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -75,7 +79,8 @@ module ChefUtils
# Determine if the current node is amazon linux.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -85,7 +90,8 @@ module ChefUtils
# Determine if the current node is redhat enterprise.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -99,7 +105,8 @@ module ChefUtils
# Determine if the current node is centos.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -110,7 +117,8 @@ module ChefUtils
# Determine if the current node is oracle linux.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -123,7 +131,8 @@ module ChefUtils
# Determine if the current node is scientific linux.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -136,7 +145,8 @@ module ChefUtils
# Determine if the current node is clearos.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -147,7 +157,8 @@ module ChefUtils
# Determine if the current node is fedora.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -157,7 +168,8 @@ module ChefUtils
# Determine if the current node is arch
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -167,7 +179,8 @@ module ChefUtils
# Determine if the current node is solaris2
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -177,7 +190,8 @@ module ChefUtils
# Determine if the current node is smartos
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -187,7 +201,8 @@ module ChefUtils
# Determine if the current node is omnios
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -198,7 +213,8 @@ module ChefUtils
# Determine if the current node is openindiana
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -209,7 +225,8 @@ module ChefUtils
# Determine if the current node is nexentacore
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -220,7 +237,8 @@ module ChefUtils
# Determine if the current node is aix
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -230,7 +248,8 @@ module ChefUtils
# Determine if the current node is freebsd
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -240,7 +259,8 @@ module ChefUtils
# Determine if the current node is openbsd
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -250,7 +270,8 @@ module ChefUtils
# Determine if the current node is netbsd
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -260,7 +281,8 @@ module ChefUtils
# Determine if the current node is dragonflybsd
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -270,7 +292,8 @@ module ChefUtils
# Determine if the current node is MacOS.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -281,7 +304,8 @@ module ChefUtils
# Determine if the current node is gentoo
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -291,7 +315,8 @@ module ChefUtils
# Determine if the current node is slackware.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -301,7 +326,8 @@ module ChefUtils
# Determine if the current node is SuSE.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -311,7 +337,8 @@ module ChefUtils
# Determine if the current node is OpenSuSE.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -325,7 +352,8 @@ module ChefUtils
# Determine if the current node is Windows.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
diff --git a/chef-utils/lib/chef-utils/dsl/platform_family.rb b/chef-utils/lib/chef-utils/dsl/platform_family.rb
index 468665728d..8efbfd4d4f 100644
--- a/chef-utils/lib/chef-utils/dsl/platform_family.rb
+++ b/chef-utils/lib/chef-utils/dsl/platform_family.rb
@@ -24,7 +24,8 @@ module ChefUtils
# Determine if the current node is a member of the 'arch' family.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -36,7 +37,8 @@ module ChefUtils
# Determine if the current node is a member of the 'aix' platform family.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -46,7 +48,8 @@ module ChefUtils
# Determine if the current node is a member of the 'debian' platform family (Debian, Ubuntu and derivatives).
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -54,9 +57,10 @@ module ChefUtils
node["platform_family"] == "debian"
end
- # Determine if the current node is a member of the 'fedora' platform family (Fedora and Arist).
+ # Determine if the current node is a member of the 'fedora' platform family (Fedora and Arista).
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -66,7 +70,8 @@ module ChefUtils
# Determine if the current node is a member of the 'mac_os_x' platform family.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -79,7 +84,8 @@ module ChefUtils
# Determine if the current node is a member of the 'rhel' platform family (Red Hat, CentOS, Oracle or Scientific Linux, but NOT Amazon Linux or Fedora).
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -90,7 +96,8 @@ module ChefUtils
# Determine if the current node is a rhel6 compatible build (Red Hat, CentOS, Oracle or Scientific Linux)
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -100,7 +107,8 @@ module ChefUtils
# Determine if the current node is a rhel7 compatible build (Red Hat, CentOS, Oracle or Scientific Linux)
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -110,7 +118,8 @@ module ChefUtils
# Determine if the current node is a rhel8 compatible build (Red Hat, CentOS, Oracle or Scientific Linux)
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -120,7 +129,8 @@ module ChefUtils
# Determine if the current node is a member of the 'amazon' platform family.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -131,7 +141,8 @@ module ChefUtils
# Determine if the current node is a member of the 'solaris2' platform family.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -143,7 +154,8 @@ module ChefUtils
# Determine if the current node is a member of the 'smartos' platform family.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -151,9 +163,10 @@ module ChefUtils
node["platform_family"] == "smartos"
end
- # Determine if the current node is a member of the 'suse' platform family (openSUSE, SLES, and SLED).
+ # Determine if the current node is a member of the 'suse' platform family (openSUSE, SLES, and SLED).
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -163,7 +176,8 @@ module ChefUtils
# Determine if the current node is a member of the 'gentoo' platform family.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -173,7 +187,8 @@ module ChefUtils
# Determine if the current node is a member of the 'freebsd' platform family.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -183,7 +198,8 @@ module ChefUtils
# Determine if the current node is a member of the 'openbsd' platform family.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -193,7 +209,8 @@ module ChefUtils
# Determine if the current node is a member of the 'netbsd' platform family.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -203,7 +220,8 @@ module ChefUtils
# Determine if the current node is a member of the 'dragonflybsd' platform family.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -213,7 +231,8 @@ module ChefUtils
# Determine if the current node is a member of the 'windows' platform family.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -231,8 +250,10 @@ module ChefUtils
node ? node["platform_family"] == "windows" : windows_ruby?
end
- # Determine if the ruby VM is currently running on a windows node (chefspec can never stub
- # this behavior, so this is useful for code which can never be parsed on a non-windows box).
+ # Determine if the Ruby VM is currently running on a Windows node (ChefSpec can never stub
+ # this behavior, so this is useful for code which can never be parsed on a non-Windows box).
+ #
+ # @since 15.5
#
# @return [Boolean]
#
@@ -252,7 +273,8 @@ module ChefUtils
# less useful since in no way can AIX trace its lineage back to old redhat distros. This is most useful for
# "smells like redhat, including SuSE".
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -260,11 +282,12 @@ module ChefUtils
fedora_derived?(node) || node["platform_family"] == "suse"
end
- # RPM-based distros which are not SuSE and are very loosely similar to fedora, using yum or dnf. The historical
- # lineage of the distro should have forked off from old redhat fedora distros at some point. Currently rhel,
- # fedora and amazon. This is most useful for "smells like redhat, but isn't SuSE".
+ # RPM-based distros which are not SuSE and are very loosely similar to fedora, using yum or dnf. The historical
+ # lineage of the distro should have forked off from old redhat fedora distros at some point. Currently rhel,
+ # fedora and amazon. This is most useful for "smells like redhat, but isn't SuSE".
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -272,10 +295,11 @@ module ChefUtils
redhat_based?(node) || node["platform_family"] == "amazon"
end
- # RedHat distros -- fedora and rhel platform_families, nothing else. This is most likely not as useful as the
+ # RedHat distros -- fedora and rhel platform_families, nothing else. This is most likely not as useful as the
# "fedora_dervied?" helper.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -285,7 +309,8 @@ module ChefUtils
# All of the Solaris-lineage.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
@@ -295,9 +320,10 @@ module ChefUtils
# All of the BSD-lineage.
#
- # Note that MacOSX is not included since Mac deviates so significantly from BSD that including it would not be useful.
+ # Note that macOS is not included since macOS deviates so significantly from BSD that including it would not be useful.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.5
#
# @return [Boolean]
#
diff --git a/chef-utils/lib/chef-utils/dsl/service.rb b/chef-utils/lib/chef-utils/dsl/service.rb
index da4ea6c8a1..be1ea0708e 100644
--- a/chef-utils/lib/chef-utils/dsl/service.rb
+++ b/chef-utils/lib/chef-utils/dsl/service.rb
@@ -28,6 +28,8 @@ module ChefUtils
# Returns if debian's old rc.d manager is installed (not necessarily the primary init system).
#
+ # @since 15.5
+ #
# @return [Boolean]
#
def debianrcd?
@@ -36,6 +38,8 @@ module ChefUtils
# Returns if debian's old invoke rc.d manager is installed (not necessarily the primary init system).
#
+ # @since 15.5
+ #
# @return [Boolean]
#
def invokercd?
@@ -44,6 +48,8 @@ module ChefUtils
# Returns if upstart is installed (not necessarily the primary init system).
#
+ # @since 15.5
+ #
# @return [Boolean]
#
def upstart?
@@ -52,6 +58,8 @@ module ChefUtils
# Returns if insserv is installed (not necessarily the primary init system).
#
+ # @since 15.5
+ #
# @return [Boolean]
#
def insserv?
@@ -60,6 +68,8 @@ module ChefUtils
# Returns if redhat's init system is installed (not necessarily the primary init system).
#
+ # @since 15.5
+ #
# @return [Boolean]
#
def redhatrcd?
diff --git a/chef-utils/lib/chef-utils/dsl/train_helpers.rb b/chef-utils/lib/chef-utils/dsl/train_helpers.rb
index a36db803f3..9c9dd3402a 100644
--- a/chef-utils/lib/chef-utils/dsl/train_helpers.rb
+++ b/chef-utils/lib/chef-utils/dsl/train_helpers.rb
@@ -1,5 +1,5 @@
-#--
-# Copyright:: Copyright 2019-2019, Chef Software Inc.
+#
+# Copyright:: Copyright 2019, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/chef-utils/lib/chef-utils/dsl/windows.rb b/chef-utils/lib/chef-utils/dsl/windows.rb
index 904e9ef126..bfe88e5e52 100644
--- a/chef-utils/lib/chef-utils/dsl/windows.rb
+++ b/chef-utils/lib/chef-utils/dsl/windows.rb
@@ -26,7 +26,8 @@ module ChefUtils
# Determine if the current node is Windows Server Core.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.7
#
# @return [Boolean]
#
@@ -34,9 +35,10 @@ module ChefUtils
node["kernel"]["server_core"] == true
end
- # Determine if the current node is Windows Workstation
+ # Determine if the current node is Windows Workstation.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.7
#
# @return [Boolean]
#
@@ -44,9 +46,10 @@ module ChefUtils
node["kernel"]["product_type"] == "Workstation"
end
- # Determine if the current node is Windows Server
+ # Determine if the current node is Windows Server.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.7
#
# @return [Boolean]
#
@@ -56,7 +59,8 @@ module ChefUtils
# Determine the current Windows NT version. The NT version often differs from the marketing version, but offers a good way to find desktop and server releases that are based on the same codebase. IE: NT 6.3 is Windows 8.1 and Windows 2012 R2.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.8
#
# @return [ChefUtils::VersionString]
#
@@ -64,9 +68,10 @@ module ChefUtils
ChefUtils::VersionString.new(node["os_version"])
end
- # Determine the installed version of PowerShell
+ # Determine the installed version of PowerShell.
#
- # @param [Chef::Node] node
+ # @param [Chef::Node] node the node to check
+ # @since 15.8
#
# @return [ChefUtils::VersionString]
#