diff options
author | Tim Smith <tsmith84@gmail.com> | 2020-04-23 23:39:22 -0700 |
---|---|---|
committer | Pete Higgins <pete@peterhiggins.org> | 2020-04-27 11:42:16 -0700 |
commit | 013c4cc4d5c97c88bf62162b87bd3d9f8908dc58 (patch) | |
tree | 3c68b26117a1d4f8c7c095ee2fd28bd661c558b3 /tasks | |
parent | 66c831231a619f433c30321c7a018d9937b9c14d (diff) | |
download | chef-013c4cc4d5c97c88bf62162b87bd3d9f8908dc58.tar.gz |
Better handle the default values
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'tasks')
-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) |