diff options
author | Tim Smith <tsmith84@gmail.com> | 2020-04-23 23:39:22 -0700 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2020-04-23 23:39:22 -0700 |
commit | 80193eea95a1199278a884f27f8ae98288a133e8 (patch) | |
tree | ee5e7ed70585dbebf8d8af08c7b7179fbed19e5d | |
parent | c12d2686e79ca659dabdf9d14c00d4d4a5278823 (diff) | |
download | chef-80193eea95a1199278a884f27f8ae98288a133e8.tar.gz |
Better handle the default values
Signed-off-by: Tim Smith <tsmith@chef.io>
-rwxr-xr-x | tasks/docs.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tasks/docs.rb b/tasks/docs.rb index 5c00976b85..d6f8f97459 100755 --- a/tasks/docs.rb +++ b/tasks/docs.rb @@ -144,6 +144,16 @@ namespace :docs_site do } end + # print out the human readable form of the default + def friendly_default_value(property) + return "The resource block's name" if property["name_property"] + + return nil if property["default"].nil? + + # this way we properly print out a string of a hash or an array instead of just the values + property["default"].to_s + end + # TODO: # - what to do about "lazy default" for default? def properties_list(properties) |