summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-05-01 21:41:52 -0700
committerTim Smith <tsmith84@gmail.com>2020-05-01 21:41:52 -0700
commitfd49902fa0739fd30e3f942c2c2124e05a92bd2f (patch)
treea72c6f1fd234a3de4328490c268160b20e6872b2
parent2a4bf3ee6d9c4ab35ea9516df163c1ea8fff2d56 (diff)
downloadchef-fd49902fa0739fd30e3f942c2c2124e05a92bd2f.tar.gz
Skip nil values in the type list
Signed-off-by: Tim Smith <tsmith@chef.io>
-rwxr-xr-xtasks/docs.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/tasks/docs.rb b/tasks/docs.rb
index 7d74c6078a..6eaa418b5f 100755
--- a/tasks/docs.rb
+++ b/tasks/docs.rb
@@ -89,8 +89,9 @@ namespace :docs_site do
end
# given an array of types print out a single comma separated string
- # handling a nil value that needs to be printed as "nil" and TrueClass/FalseClass
- # which needs to be "true" and "false"
+ # handling TrueClass/FalseClass which needs to be "true" and "false"
+ # and removing any nil values since those are less types in properties
+ # and more side effects of legacy design
# @return String
# TODO:
# - still does not include nil (?)
@@ -101,12 +102,13 @@ namespace :docs_site do
"true"
when "FalseClass"
"false"
- when "NilClass", nil
- "nil"
+ when "NilClass"
+ nil
else
x
end
end
+ # compact to remove the nil values
fixed_arr.compact.join(", ")
end