-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.md.erb
169 lines (127 loc) · 4.67 KB
/
README.md.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
[![Build Status](https://travis-ci.org/sbp-cookbooks/sbp_messageanalyzer.svg?branch=master)](https://travis-ci.org/sbp-cookbooks/sbp_messageanalyzer) [![Cookbook Version](https://img.shields.io/cookbook/v/sbp_messageanalyzer.svg)](https://supermarket.chef.io/cookbooks/sbp_messageanalyzer)
# Description
<% unless fragments['overview'] -%>
<%= description %>
<% else -%>
<%= fragments['overview'] -%>
<% end -%>
# Requirements
<% if fragments['requirements'] -%>
<%= fragments['requirements'] -%>
<% end -%>
## Platform:
<% unless platforms.empty? %>
<% platforms.sort.each do |platform| %>
* <%= platform.capitalize %>
<% end %>
<% else %>
*No platforms defined*
<% end %>
## Cookbooks:
<% unless dependencies.empty? %>
<% dependencies.sort.each do |cookbook| %>
* <%= cookbook %>
<% end %>
<% else %>
*No dependencies defined*
<% end %>
# Attributes
<% unless attributes.empty? %>
<% attributes.each do |name, description, default, choice| %>
* `<%= name %>` - <%= description %><% if !description.nil? && !description.strip.end_with?(".") %>.<% end %> <% unless choice.empty? %>Available options: <%= "`#{choice.map(&:inspect).join('`, `')}`" %>. <% end %>Defaults to `<%= default %>`.
<% end %>
<% else %>
*No attributes defined*
<% end %>
# Recipes
<% unless recipes.empty? %>
<% recipes.each do |recipe| %>
* <% if recipe.top_level_descriptions.empty? %><%= recipe.name %><% else %>[<%= recipe.name %>](#<%= recipe.name.gsub(':','') %>)<% end %><% if recipe.short_description != '' %> - <%= recipe.short_description %><% end %>
<% end %>
<% recipes.each do |recipe| -%>
<% unless recipe.top_level_descriptions.empty? -%>
## <%= recipe.name %>
<% if recipe.top_level_description('main') != '' -%>
<%= recipe.top_level_description('main') %>
<% end -%>
<% recipe.top_level_descriptions.keys.select{|k| k != 'main'}.each do |key| -%>
### <%= key -%>
<%= recipe.top_level_description(key) %>
<% end -%>
<% end -%>
<% end -%>
<% else -%>
*No recipes defined*
<% end -%>
<% unless definitions.empty? -%>
# Definitions
<% definitions.each do |definition| -%>
* [<%= definition.name %>](#<%= definition.name %>)<% if definition.short_description %> - <%= definition.short_description %><% end %>
<% end -%>
<% definitions.each do |definition| -%>
## <%= definition.name %>
<% if definition.top_level_description('main') != '' -%>
<%= definition.top_level_description('main') -%>
<% end -%>
<% unless definition.params.empty? -%>
### Parameters
<% definition.params.each do |param, data| -%>
- <%= param %>: <%= data['descr'] %>.<% if data['default']%> Defaults to: <%=data['default']%><%end%>
<% end -%>
<% end -%>
<% definition.top_level_descriptions.keys.select{|k| k != 'main'}.each do |key| -%>
### <%= key -%>
<%= definition.top_level_description(key) -%>
<% end -%>
<% end -%>
<% end -%>
<% unless resources.empty? -%>
# Resources
<% resources.each do |resource| %>
* [<%= resource.name %>](#<%= resource.name %>)<% if resource.short_description %> - <%= resource.short_description %><% end %>
<% end %>
<% resources.each do |resource| -%>
## <%= resource.name %>
<% if resource.top_level_description('main') != '' -%>
<%= resource.top_level_description('main') -%>
<% end -%>
<% unless resource.actions.empty? -%>
### Actions
<% if resource.default_action.is_a?(Array) %>
- Default actions: [<%= resource.default_action.join ', ' %>]
<% end %>
<% resource.actions.each do |action| -%>
- <%= action %>: <%= resource.action_description(action) %><% if !resource.default_action.is_a?(Array) && resource.default_action == action %> Default action.<% end %>
<% end -%>
<% end -%>
<% unless resource.attributes.empty? -%>
### Attribute Parameters
<% resource.attributes.each do |attribute| -%>
- <%= attribute %>: <%= resource.attribute_description(attribute) %><% if resource.attribute_has_default_value?(attribute) %> Defaults to <code><%= resource.attribute_default_value(attribute).inspect %></code>.<% end %>
<% end -%>
<% end -%>
<% resource.top_level_descriptions.keys.select{|k| k != 'main'}.each do |key| -%>
### <%= key -%>
<%= resource.top_level_description(key) -%>
<% end -%>
<% end -%>
<% end -%>
<% fragments.keys.select {|k|k != 'overview' && k != 'credit' && k != 'requirements'}.each do |key| -%>
<%= fragments[key] %>
<% end -%>
<% unless fragments['credit'] -%>
# License and Maintainer
Maintainer: <%= maintainer %> (<<%= maintainer_email %>>)
<%= 'Source: ' + source_url %><br>
<%= 'Issues: ' + issues_url %>
License: <%= license %>
<% else -%>
<%= fragments['credit'] -%>
<% end -%>
# Contributing
1. Fork the repository on Github
2. Create a named feature branch (i.e. `add-new-recipe`)
3. Write you change
4. Write tests for your change (if applicable)
5. Run the tests, ensuring they all pass
6. Submit a Pull Request