summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-10-28 09:47:30 -0700
committerTim Smith <tsmith84@gmail.com>2020-10-28 09:47:30 -0700
commit5b54538e22189fea3ba05539fde67a60638194d0 (patch)
tree0c7217a77a88d1f46319b9d80e73489defa39029
parent24cb7c539e852ca13c535cdf0d9624b5d5f770da (diff)
downloadchef-5b54538e22189fea3ba05539fde67a60638194d0.tar.gz
Remove .nil? and add some yard explaining what this method is
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--chef-config/lib/chef-config/mixin/fuzzy_hostname_matcher.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/chef-config/lib/chef-config/mixin/fuzzy_hostname_matcher.rb b/chef-config/lib/chef-config/mixin/fuzzy_hostname_matcher.rb
index 05188d44aa..533db85860 100644
--- a/chef-config/lib/chef-config/mixin/fuzzy_hostname_matcher.rb
+++ b/chef-config/lib/chef-config/mixin/fuzzy_hostname_matcher.rb
@@ -20,8 +20,16 @@ module ChefConfig
module Mixin
module FuzzyHostnameMatcher
+ #
+ # Check to see if a hostname matches a match string. Used to see if hosts fall under our no_proxy config
+ #
+ # @param [String] hostname the hostname to check
+ # @param [String] matches the pattern to match
+ #
+ # @return [Boolean]
+ #
def fuzzy_hostname_match_any?(hostname, matches)
- unless hostname.nil? || matches.nil?
+ if hostname && matches
return matches.to_s.split(/\s*,\s*/).compact.any? do |m|
fuzzy_hostname_match?(hostname, m)
end