knife-cookbook-doc 0.30.0 → 0.31.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d4b4645d7d5c912ee0727e526541469198e048c75792d308624039278329a729
4
- data.tar.gz: 60ba6053bb465d1e50cca894de9ff772a6e0ab180b78800c738bd9e67136c142
3
+ metadata.gz: 32146e1b9e4922d6ad79b91e13b265644ab5d015f0c5cbdb3ee19cbc41d7e3da
4
+ data.tar.gz: 7b743e9a1dd63eb357f54bc3713c81c902f86f740163da01456cf7035b481913
5
5
  SHA512:
6
- metadata.gz: a31986554dce09246b247c9c50a10d720f8025a02eb059fea3b4d8dc3deb7f64dc10a70488eb37fd2e57d56d7518a2d3516d469682c54d04949912a34a0f2d5d
7
- data.tar.gz: f91942855366f6cb84292754909217b881d9292d5e3c3843062aebba7865507b6e3da3a266afb9b73778ff8ede007e4c53b54921cf63db78fd9bdae28f50d20e
6
+ metadata.gz: b53f6f936367ddd06a000582f7c7e7f8aed90b277854d579933abbb31b2476920d9f9bb5fd1b9991ec25164dd2325c88feeb6db35225390b76a86fea5fc43d23
7
+ data.tar.gz: 4cd5dff63120570a7ecfe3bb5da66fab1d2918c41f5b7c1334fc6e31d7048ada30678a9b8e17cd96527420bed0346c522d4165b5e23c9b6fed3ea479e54afe17
data/.travis.yml CHANGED
@@ -5,33 +5,83 @@ gemfile: fixture/gemfile
5
5
  rvm:
6
6
  - 2.2.6
7
7
  - 2.3.3
8
+ - 2.6.7
9
+ - 2.7.3
8
10
 
9
11
  env:
10
- - CHEF_VERSION=master
11
- - CHEF_VERSION=12.5.1
12
- - CHEF_VERSION=12.4.1
13
- - CHEF_VERSION=12.3.0
14
- - CHEF_VERSION=12.2.1
15
- - CHEF_VERSION=12.1.2
16
- - CHEF_VERSION=12.0.3
17
- - CHEF_VERSION=11.18.12
18
- - CHEF_VERSION=11.16.4
19
- - CHEF_VERSION=11.14.6
20
- - CHEF_VERSION=11.12.8
21
- - CHEF_VERSION=11.10.4
12
+ - CHEF_VERSION=master EXPECTED_FILE=README-expected.md METADATA=metadata.rb
13
+ - CHEF_VERSION=16.13.16 EXPECTED_FILE=README-expected.md METADATA=metadata.rb
14
+ - CHEF_VERSION=15.17.4 EXPECTED_FILE=README-expected.md METADATA=metadata.rb
15
+ - CHEF_VERSION=12.6.0 EXPECTED_FILE=README-expected.md METADATA=metadata.rb
16
+ - CHEF_VERSION=12.5.1 EXPECTED_FILE=README-expected_legacy.md METADATA=metadata_legacy.rb
17
+ - CHEF_VERSION=12.4.1 EXPECTED_FILE=README-expected_legacy.md METADATA=metadata_legacy.rb
18
+ - CHEF_VERSION=12.3.0 EXPECTED_FILE=README-expected_legacy.md METADATA=metadata_legacy.rb
19
+ - CHEF_VERSION=12.2.1 EXPECTED_FILE=README-expected_legacy.md METADATA=metadata_legacy.rb
20
+ - CHEF_VERSION=12.1.2 EXPECTED_FILE=README-expected_legacy.md METADATA=metadata_legacy.rb
21
+ - CHEF_VERSION=12.0.3 EXPECTED_FILE=README-expected_legacy.md METADATA=metadata_legacy.rb
22
+ - CHEF_VERSION=11.18.12 EXPECTED_FILE=README-expected_legacy.md METADATA=metadata_legacy.rb
23
+ - CHEF_VERSION=11.16.4 EXPECTED_FILE=README-expected_legacy.md METADATA=metadata_legacy.rb
24
+ - CHEF_VERSION=11.14.6 EXPECTED_FILE=README-expected_legacy.md METADATA=metadata_legacy.rb
25
+ - CHEF_VERSION=11.12.8 EXPECTED_FILE=README-expected_legacy.md METADATA=metadata_legacy.rb
26
+ - CHEF_VERSION=11.10.4 EXPECTED_FILE=README-expected_legacy.md METADATA=metadata_legacy.rb
22
27
 
23
28
  matrix:
24
29
  fast_finish: true
25
30
  exclude:
26
- - env: CHEF_VERSION=11.12.8
31
+ - env: CHEF_VERSION=11.12.8 EXPECTED_FILE=README-expected_legacy.md METADATA=metadata_legacy.rb
27
32
  rvm: 2.3.3
28
- - env: CHEF_VERSION=11.10.4
33
+ - env: CHEF_VERSION=11.10.4 EXPECTED_FILE=README-expected_legacy.md METADATA=metadata_legacy.rb
29
34
  rvm: 2.3.3
35
+ # As of May 28 2021, chef/chef master requires 2.7 or higher
36
+ - env: CHEF_VERSION=master EXPECTED_FILE=README-expected.md METADATA=metadata.rb
37
+ rvm: 2.2.6
38
+ - env: CHEF_VERSION=master EXPECTED_FILE=README-expected.md METADATA=metadata.rb
39
+ rvm: 2.3.3
40
+ - env: CHEF_VERSION=master EXPECTED_FILE=README-expected.md METADATA=metadata.rb
41
+ rvm: 2.6.7
42
+ # Newer Chef does not work with old Ruby
43
+ - env: CHEF_VERSION=16.13.16 EXPECTED_FILE=README-expected.md METADATA=metadata.rb
44
+ rvm: 2.2.6
45
+ - env: CHEF_VERSION=15.17.4 EXPECTED_FILE=README-expected.md METADATA=metadata.rb
46
+ rvm: 2.2.6
47
+ - env: CHEF_VERSION=16.13.16 EXPECTED_FILE=README-expected.md METADATA=metadata.rb
48
+ rvm: 2.3.3
49
+ - env: CHEF_VERSION=15.17.4 EXPECTED_FILE=README-expected.md METADATA=metadata.rb
50
+ rvm: 2.3.3
51
+ # Old Chef bundles old json package incompatible with newer Ruby
52
+ - env: CHEF_VERSION=12.1.2 EXPECTED_FILE=README-expected_legacy.md METADATA=metadata_legacy.rb
53
+ rvm: 2.6.7
54
+ - env: CHEF_VERSION=12.1.2 EXPECTED_FILE=README-expected_legacy.md METADATA=metadata_legacy.rb
55
+ rvm: 2.7.3
56
+ - env: CHEF_VERSION=12.0.3 EXPECTED_FILE=README-expected_legacy.md METADATA=metadata_legacy.rb
57
+ rvm: 2.6.7
58
+ - env: CHEF_VERSION=12.0.3 EXPECTED_FILE=README-expected_legacy.md METADATA=metadata_legacy.rb
59
+ rvm: 2.7.3
60
+ - env: CHEF_VERSION=11.18.12 EXPECTED_FILE=README-expected_legacy.md METADATA=metadata_legacy.rb
61
+ rvm: 2.6.7
62
+ - env: CHEF_VERSION=11.18.12 EXPECTED_FILE=README-expected_legacy.md METADATA=metadata_legacy.rb
63
+ rvm: 2.7.3
64
+ - env: CHEF_VERSION=11.16.4 EXPECTED_FILE=README-expected_legacy.md METADATA=metadata_legacy.rb
65
+ rvm: 2.6.7
66
+ - env: CHEF_VERSION=11.16.4 EXPECTED_FILE=README-expected_legacy.md METADATA=metadata_legacy.rb
67
+ rvm: 2.7.3
68
+ - env: CHEF_VERSION=11.14.6 EXPECTED_FILE=README-expected_legacy.md METADATA=metadata_legacy.rb
69
+ rvm: 2.6.7
70
+ - env: CHEF_VERSION=11.14.6 EXPECTED_FILE=README-expected_legacy.md METADATA=metadata_legacy.rb
71
+ rvm: 2.7.3
72
+ - env: CHEF_VERSION=11.12.8 EXPECTED_FILE=README-expected_legacy.md METADATA=metadata_legacy.rb
73
+ rvm: 2.6.7
74
+ - env: CHEF_VERSION=11.12.8 EXPECTED_FILE=README-expected_legacy.md METADATA=metadata_legacy.rb
75
+ rvm: 2.7.3
76
+ - env: CHEF_VERSION=11.10.4 EXPECTED_FILE=README-expected_legacy.md METADATA=metadata_legacy.rb
77
+ rvm: 2.6.7
78
+ - env: CHEF_VERSION=11.10.4 EXPECTED_FILE=README-expected_legacy.md METADATA=metadata_legacy.rb
79
+ rvm: 2.7.3
30
80
 
31
81
  allow_failures:
32
- - env: CHEF_VERSION=master
82
+ - env: CHEF_VERSION=master EXPECTED_FILE=README-expected.md METADATA=metadata.rb
33
83
 
34
84
  script:
35
85
  - cd fixture
36
- - bundle exec knife cookbook doc . -o README-generated.md -c knife.rb
37
- - diff README-expected.md README-generated.md && rm README-generated.md
86
+ - bundle exec knife cookbook doc . -o README-generated.md -c knife.rb --metadata $METADATA
87
+ - diff $EXPECTED_FILE README-generated.md && rm README-generated.md
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # v0.31.0 (Feb 7 2022)
2
+
3
+ * Prettify Chef version constraints.
4
+
1
5
  # v0.30.0 (Mar 19 2021)
2
6
 
3
7
  * Support a space after # in custom resource. Submitted by Tomoya Kabe.
@@ -9,7 +9,8 @@
9
9
 
10
10
  ## Chef Client:
11
11
 
12
- *No Chef versions defined*
12
+ * chef (>= 14.0, < 16.0)
13
+ * chef (= 12.0)
13
14
 
14
15
  ## Platform:
15
16
 
@@ -0,0 +1,75 @@
1
+ # Description
2
+
3
+ # My Cookbook Readme
4
+
5
+ **`knife cookbook doc .` _rocks_**
6
+
7
+ # Requirements
8
+
9
+
10
+ ## Chef Client:
11
+
12
+ *No Chef versions defined*
13
+
14
+ ## Platform:
15
+
16
+ * cookbook-authors
17
+
18
+ ## Cookbooks:
19
+
20
+ * upon-magic
21
+
22
+ # Attributes
23
+
24
+ * `node['knife']['cookbook']['doc']` - Defaults to `successful automation`.
25
+
26
+ # Recipes
27
+
28
+ * [fixture::default](#fixturedefault) - The recipe is awesome.
29
+
30
+ ## fixture::default
31
+
32
+ The recipe is awesome. It does thing 1, thing 2 and thing 3!
33
+
34
+ MyApp Admin Group: The group allowed to manage MyApp.
35
+
36
+ # Resources
37
+
38
+ * [fixture](#fixture) - This resource is awesome.
39
+ * [fixture_space](#fixture_space) - This resource is spacial.
40
+
41
+ ## fixture
42
+
43
+ This resource is awesome.
44
+
45
+ ### Actions
46
+
47
+ - stuff: Does awesome things. Default action.
48
+
49
+ ### Attribute Parameters
50
+
51
+ - my_attribute: This is an attribute. Defaults to <code>"a default value"</code>.
52
+ - my_property: This is a property. Defaults to <code>"another default value"</code>.
53
+
54
+ ## fixture_space
55
+
56
+ This resource is spacial.
57
+
58
+ ### Actions
59
+
60
+ - stuff: Inserts spaces. Default action.
61
+
62
+ ### Attribute Parameters
63
+
64
+ - my_attribute: This is an attribute. Defaults to <code>"a default value"</code>.
65
+ - my_property: This is a property. Defaults to <code>"another default value"</code>.
66
+
67
+ # Libraries
68
+
69
+ ## stooges()
70
+ Returns `['Moe', 'Larry', 'Curly']`
71
+
72
+ # Credits
73
+
74
+ * Mathias Lafeldt
75
+ * Peter Donald
data/fixture/gemfile CHANGED
@@ -2,6 +2,7 @@ source 'https://rubygems.org/'
2
2
 
3
3
  if ENV['CHEF_VERSION'] == 'master'
4
4
  gem 'chef', github: 'chef/chef'
5
+ gem 'knife', github: 'chef/chef'
5
6
  else
6
7
  gem 'chef', ENV['CHEF_VERSION']
7
8
  end
data/fixture/metadata.rb CHANGED
@@ -5,6 +5,8 @@ license 'MIT'
5
5
  description 'Installs/Configures fixture'
6
6
  long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
7
7
  version '0.1.0'
8
+ chef_version '>= 14.0', '< 16.0'
9
+ chef_version '= 12.0'
8
10
 
9
11
  supports 'cookbook-authors'
10
12
  depends 'upon-magic'
@@ -0,0 +1,10 @@
1
+ name 'fixture'
2
+ maintainer 'A Cookbook Author'
3
+ maintainer_email 'author@example.com'
4
+ license 'MIT'
5
+ description 'Installs/Configures fixture'
6
+ long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
7
+ version '0.1.0'
8
+
9
+ supports 'cookbook-authors'
10
+ depends 'upon-magic'
@@ -43,6 +43,11 @@ module KnifeCookbookDoc
43
43
  :default => false,
44
44
  :description => 'Ignore attributes without documetation'
45
45
 
46
+ option :metadata,
47
+ :long => '--metadata FILE',
48
+ :default => 'metadata.rb',
49
+ :description => 'metadata.rb path'
50
+
46
51
  def run
47
52
  unless (cookbook_dir = name_args.first)
48
53
  ui.fatal 'Please provide cookbook directory as an argument'
@@ -13,7 +13,7 @@ module KnifeCookbookDoc
13
13
  def initialize(cookbook_dir, config)
14
14
 
15
15
  @metadata = Chef::Cookbook::Metadata.new
16
- @metadata.from_file("#{cookbook_dir}/metadata.rb")
16
+ @metadata.from_file("#{cookbook_dir}/#{config[:metadata]}")
17
17
 
18
18
  if (!@metadata.attributes.empty? rescue false)
19
19
  @attributes = @metadata.attributes.map do |attr, options|
@@ -110,8 +110,9 @@ module KnifeCookbookDoc
110
110
 
111
111
  def chef_versions
112
112
  if @metadata.methods.include?(:chef_version)
113
- @metadata.chef_versions.map do |chef_version, version|
114
- format_constraint(chef_version, version)
113
+ @metadata.chef_versions.map do |chef_version|
114
+ constraints = chef_version.requirements_list.join(', ')
115
+ format_constraint(chef_version.name, constraints)
115
116
  end
116
117
  else
117
118
  []
@@ -1,3 +1,3 @@
1
1
  module KnifeCookbookDoc
2
- VERSION = '0.30.0'
2
+ VERSION = '0.31.0'
3
3
  end
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.30.0
4
+ version: 0.31.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: 2021-03-19 00:00:00.000000000 Z
12
+ date: 2022-02-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: chef
@@ -88,6 +88,7 @@ files:
88
88
  - Rakefile
89
89
  - fixture/CHANGELOG.md
90
90
  - fixture/README-expected.md
91
+ - fixture/README-expected_legacy.md
91
92
  - fixture/README.md
92
93
  - fixture/attributes/default.rb
93
94
  - fixture/doc/credit.md
@@ -96,6 +97,7 @@ files:
96
97
  - fixture/knife.rb
97
98
  - fixture/libraries/default.rb
98
99
  - fixture/metadata.rb
100
+ - fixture/metadata_legacy.rb
99
101
  - fixture/recipes/default.rb
100
102
  - fixture/resources/default.rb
101
103
  - fixture/resources/space.rb
@@ -133,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
135
  - !ruby/object:Gem::Version
134
136
  version: '0'
135
137
  requirements: []
136
- rubygems_version: 3.1.4
138
+ rubygems_version: 3.1.2
137
139
  signing_key:
138
140
  specification_version: 4
139
141
  summary: Knife plugin to generate README.md for a cookbook