summaryrefslogtreecommitdiff
path: root/tasks
diff options
context:
space:
mode:
authorMarc A. Paradise <marcparadise@users.noreply.github.com>2021-02-04 16:34:47 -0500
committerGitHub <noreply@github.com>2021-02-04 13:34:47 -0800
commit4fef40edebd8d77f0222605f7c46350464a0206c (patch)
tree25586abb268968ae194c8ca3ccbc93f5bdc52bd8 /tasks
parent97c8873fc8e51bfb563ea89779103f31e7e30d30 (diff)
downloadchef-4fef40edebd8d77f0222605f7c46350464a0206c.tar.gz
Add support for resource action descriptions (#10986)
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'tasks')
-rwxr-xr-xtasks/docs.rb11
1 files changed, 4 insertions, 7 deletions
diff --git a/tasks/docs.rb b/tasks/docs.rb
index b815988b8b..5d336a7b14 100755
--- a/tasks/docs.rb
+++ b/tasks/docs.rb
@@ -126,17 +126,14 @@ namespace :docs_site do
#
# Build the actions section of the resource yaml
+ # as a hash of actions to markdown descriptions.
#
# @return [Hash]
#
def action_list(actions)
- list = {}
- actions.sort.each do |action|
- # nothing is a special case that sources the content from the docs site
- list[action.to_sym] = (action == "nothing" ? { "shortcode" => "resources_common_actions_nothing.md" } : { "markdown" => nil })
- end
-
- list
+ actions = actions.map { |k, v| [k.to_sym, { "markdown" => v } ] }.to_h
+ actions[:nothing] = { "shortcode" => "resources_common_actions_nothing.md" }
+ actions
end
# TODO: