From 26e0d499a87f5155dfb2d46fd22ccb5d6c6ea4f9 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Mon, 3 Feb 2020 15:05:52 -0800 Subject: Expand the chef-utils yard for better vscode plugin generation I'm generating the plugin off these comments. Clean them up a bit and add @since so I can get that information added to the plugin snippets. Signed-off-by: Tim Smith --- chef-utils/lib/chef-utils/dsl/architecture.rb | 38 +++++++--- chef-utils/lib/chef-utils/dsl/cloud.rb | 50 +++++++------ chef-utils/lib/chef-utils/dsl/introspection.rb | 15 ++-- chef-utils/lib/chef-utils/dsl/os.rb | 10 +-- chef-utils/lib/chef-utils/dsl/path_sanity.rb | 1 + chef-utils/lib/chef-utils/dsl/platform.rb | 84 ++++++++++++++-------- chef-utils/lib/chef-utils/dsl/platform_family.rb | 92 +++++++++++++++--------- chef-utils/lib/chef-utils/dsl/service.rb | 10 +++ chef-utils/lib/chef-utils/dsl/train_helpers.rb | 4 +- chef-utils/lib/chef-utils/dsl/windows.rb | 21 +++--- 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 24f09d638c..734c7412aa 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] # @@ -74,9 +79,10 @@ module ChefUtils # chef-sugar backcompat method 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] # @@ -84,9 +90,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] # @@ -94,9 +101,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] # @@ -104,10 +112,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] # @@ -117,10 +125,10 @@ module ChefUtils # chef-sugar backcompat method 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 618147b7e1..ba65cf2881 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 3968a20f15..8af405d51c 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] # @@ -45,7 +46,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] # @@ -57,7 +59,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] # @@ -69,7 +72,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] # @@ -79,7 +83,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] # @@ -89,7 +94,8 @@ module ChefUtils # Determine if the current node is Red Hat Enterprise Linux. # - # @param [Chef::Node] node + # @param [Chef::Node] node the node to check + # @since 15.5 # # @return [Boolean] # @@ -105,7 +111,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] # @@ -117,7 +124,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] # @@ -131,7 +139,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] # @@ -145,7 +154,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] # @@ -157,7 +167,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] # @@ -167,7 +178,8 @@ module ChefUtils # Determine if the current node is Arch Linux # - # @param [Chef::Node] node + # @param [Chef::Node] node the node to check + # @since 15.5 # # @return [Boolean] # @@ -177,7 +189,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] # @@ -187,7 +200,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] # @@ -197,7 +211,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] # @@ -209,7 +224,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] # @@ -221,7 +237,8 @@ module ChefUtils # Determine if the current node is Nexenta Core Platform aka Nexenta OS. # - # @param [Chef::Node] node + # @param [Chef::Node] node the node to check + # @since 15.5 # # @return [Boolean] # @@ -233,7 +250,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] # @@ -243,7 +261,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] # @@ -253,7 +272,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] # @@ -263,7 +283,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] # @@ -273,7 +294,8 @@ module ChefUtils # Determine if the current node is DragonFly BSD. # - # @param [Chef::Node] node + # @param [Chef::Node] node the node to check + # @since 15.5 # # @return [Boolean] # @@ -283,7 +305,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] # @@ -295,7 +318,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] # @@ -305,7 +329,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] # @@ -315,7 +340,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] # @@ -325,7 +351,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] # @@ -342,7 +369,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 6fa7b7829b..9d0c878cb7 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] # @@ -82,7 +87,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] # @@ -94,7 +100,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] # @@ -104,7 +111,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] # @@ -114,7 +122,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] # @@ -124,7 +133,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] # @@ -136,7 +146,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] # @@ -148,7 +159,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] # @@ -156,9 +168,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] # @@ -168,7 +181,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] # @@ -178,7 +192,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] # @@ -188,7 +203,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] # @@ -198,7 +214,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] # @@ -208,7 +225,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] # @@ -218,7 +236,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] # @@ -236,8 +255,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] # @@ -257,7 +278,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] # @@ -265,11 +287,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] # @@ -277,10 +300,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] # @@ -290,7 +314,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] # @@ -300,9 +325,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 32fb8cf5a6..2ab44383da 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] # -- cgit v1.2.1