knife-cookbook-doc 0.28.0 → 0.29.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +4 -0
- data/Rakefile +9 -0
- data/fixture/README-expected.md +5 -0
- data/fixture/libraries/default.rb +7 -0
- data/lib/chef/knife/README.md.erb +7 -0
- data/lib/chef/knife/cookbook_doc.rb +1 -0
- data/lib/knife_cookbook_doc/libraries_model.rb +13 -0
- data/lib/knife_cookbook_doc/rake_task.rb +1 -0
- data/lib/knife_cookbook_doc/readme_model.rb +6 -0
- data/lib/knife_cookbook_doc/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d4e4e61d176043dd41fa77782ac36203bc1251a
|
4
|
+
data.tar.gz: 49a72076fe65ea3f15878479e7c709394e2bc14c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 325f8c3e22e8f67778480106847aafbccc2d7da9d58831005f3fa09b7e3de3c4710c9a05e6023718a8669c064e51c94f3cc8cf5305752704e5d6a587d5c89fae
|
7
|
+
data.tar.gz: 876de6b5caff31196e93bd7dd71c8b5fb1c6bec5725a95c24644595ae19954de6a043d1e987be44df56c67c1e376eec46bec027bcd9ef285ce0b7393347e97da
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
data/Rakefile
CHANGED
@@ -4,3 +4,12 @@ require 'rake/clean'
|
|
4
4
|
task :default => :build
|
5
5
|
|
6
6
|
CLEAN.include 'pkg'
|
7
|
+
|
8
|
+
task :test => :install
|
9
|
+
task :test do
|
10
|
+
sh <<SCRIPT
|
11
|
+
cd fixture
|
12
|
+
knife cookbook doc . -o README-generated.md -c knife.rb
|
13
|
+
diff -u README-expected.md README-generated.md && rm README-generated.md
|
14
|
+
SCRIPT
|
15
|
+
end
|
data/fixture/README-expected.md
CHANGED
@@ -50,6 +50,11 @@ This resource is awesome.
|
|
50
50
|
- my_attribute: This is an attribute. Defaults to <code>"a default value"</code>.
|
51
51
|
- my_property: This is a property. Defaults to <code>"another default value"</code>.
|
52
52
|
|
53
|
+
# Libraries
|
54
|
+
|
55
|
+
## stooges()
|
56
|
+
Returns `['Moe', 'Larry', 'Curly']`
|
57
|
+
|
53
58
|
# Credits
|
54
59
|
|
55
60
|
* Mathias Lafeldt
|
@@ -157,6 +157,13 @@
|
|
157
157
|
<%= resource.top_level_description(key) -%>
|
158
158
|
<% end -%>
|
159
159
|
|
160
|
+
<% end -%>
|
161
|
+
<% end -%>
|
162
|
+
<% unless libraries.empty? -%>
|
163
|
+
# Libraries
|
164
|
+
<% libraries.each do |lib| -%>
|
165
|
+
|
166
|
+
<%= lib.descriptions %>
|
160
167
|
<% end -%>
|
161
168
|
<% end -%>
|
162
169
|
<% fragments.keys.select {|k|k != 'overview' && k != 'credit' && k != 'requirements'}.each do |key| -%>
|
@@ -9,6 +9,7 @@ module KnifeCookbookDoc
|
|
9
9
|
require 'knife_cookbook_doc/base_model'
|
10
10
|
require 'knife_cookbook_doc/documenting_lwrp_base'
|
11
11
|
require 'knife_cookbook_doc/definitions_model'
|
12
|
+
require 'knife_cookbook_doc/libraries_model'
|
12
13
|
require 'knife_cookbook_doc/readme_model'
|
13
14
|
require 'knife_cookbook_doc/recipe_model'
|
14
15
|
require 'knife_cookbook_doc/resource_model'
|
@@ -6,6 +6,7 @@ require 'rake/tasklib'
|
|
6
6
|
require 'knife_cookbook_doc/base_model'
|
7
7
|
require 'knife_cookbook_doc/documenting_lwrp_base'
|
8
8
|
require 'knife_cookbook_doc/definitions_model'
|
9
|
+
require 'knife_cookbook_doc/libraries_model'
|
9
10
|
require 'knife_cookbook_doc/readme_model'
|
10
11
|
require 'knife_cookbook_doc/recipe_model'
|
11
12
|
require 'knife_cookbook_doc/resource_model'
|
@@ -8,6 +8,8 @@ module KnifeCookbookDoc
|
|
8
8
|
class ReadmeModel
|
9
9
|
DEFAULT_CONSTRAINT = ">= 0.0.0".freeze
|
10
10
|
|
11
|
+
attr_reader :libraries
|
12
|
+
|
11
13
|
def initialize(cookbook_dir, config)
|
12
14
|
|
13
15
|
@metadata = Chef::Cookbook::Metadata.new
|
@@ -28,6 +30,10 @@ module KnifeCookbookDoc
|
|
28
30
|
end
|
29
31
|
end
|
30
32
|
|
33
|
+
@libraries = Dir["#{cookbook_dir}/libraries/*.rb"].sort.map do |path|
|
34
|
+
LibrariesModel.new(@metadata.name, path)
|
35
|
+
end
|
36
|
+
|
31
37
|
@resources = []
|
32
38
|
Dir["#{cookbook_dir}/resources/*.rb"].sort.each do |resource_filename|
|
33
39
|
@resources << ResourceModel.new(@metadata.name, resource_filename)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knife-cookbook-doc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.29.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mathias Lafeldt
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-06-
|
12
|
+
date: 2020-06-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: chef
|
@@ -94,6 +94,7 @@ files:
|
|
94
94
|
- fixture/doc/overview.md
|
95
95
|
- fixture/gemfile
|
96
96
|
- fixture/knife.rb
|
97
|
+
- fixture/libraries/default.rb
|
97
98
|
- fixture/metadata.rb
|
98
99
|
- fixture/recipes/default.rb
|
99
100
|
- fixture/resources/default.rb
|
@@ -104,6 +105,7 @@ files:
|
|
104
105
|
- lib/knife_cookbook_doc/base_model.rb
|
105
106
|
- lib/knife_cookbook_doc/definitions_model.rb
|
106
107
|
- lib/knife_cookbook_doc/documenting_lwrp_base.rb
|
108
|
+
- lib/knife_cookbook_doc/libraries_model.rb
|
107
109
|
- lib/knife_cookbook_doc/rake_task.rb
|
108
110
|
- lib/knife_cookbook_doc/readme_model.rb
|
109
111
|
- lib/knife_cookbook_doc/recipe_model.rb
|