puppet-doc-lint 0.1.1 → 0.2.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
  SHA1:
3
- metadata.gz: 2da6511d00ad5fd50a6c05b16f4cb40409849e7e
4
- data.tar.gz: cd83dc46eeed2e6c4141aed1571f48a10d4fdb68
3
+ metadata.gz: 70a3379e492215be1a969178afa712b05c11e543
4
+ data.tar.gz: 03e079e6f1062f0134c62a5c405f7d5122551dba
5
5
  SHA512:
6
- metadata.gz: 32948a5194dc971aead38a6e27b72427762e75a55ddba7e44a6ddf099da2e81f2869682aff115ccf94765cdb8f75074b4d83a3f39edfc303622f45e1efb2daa9
7
- data.tar.gz: 7822554728c74750e2b270d97b3fd0d52235f0661b92d9b155d201f98cc5d1a44e2629edb5b43289b8705d2a83601284486fd3be73eee9b907a4bf9b11277bc1
6
+ metadata.gz: 5afa27a3e693af0a682607a823ca02591ce05a9e5408d18c443dc932f1c748df31baa7200aca597d022909ec8fd894c886501e036617c41e62387932bb4a424e
7
+ data.tar.gz: ef1b370a69ed9abe5c4549c1b4937326830512e4ed7fa6fdfc4877df99631de70f7075933a73cfb681aebd8accc5b5e87fc441148dc4fc6656d6494d0c8b0726
data/.travis.yml CHANGED
@@ -1,6 +1,5 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.9.2
4
3
  - 1.9.3
5
4
  - 2.0.0
6
5
  - ruby-head
data/bin/puppet-doc-lint CHANGED
@@ -37,7 +37,7 @@ coverage = parameters_documented_total.percent_of(parameters_total) unless param
37
37
  puts "\n\n"
38
38
  puts "Number of files: #{tally}"
39
39
  puts "Total variables: #{parameters_total}"
40
- puts "Total missing variables: #{parameters_total}"
40
+ puts "Total missing variables: #{parameters_undocumented_total}"
41
41
  puts "Documented variables: #{parameters_documented_total}"
42
42
  puts "Documentation coverage: #{coverage.round(2)}%"
43
43
 
@@ -3,7 +3,7 @@ class PuppetDocLint
3
3
 
4
4
  def initialize(file)
5
5
  # Read file and return parsed object
6
- pparser = Puppet::Parser::Parser.new('production')
6
+ pparser = Puppet::Parser::Parser.new(Puppet::Node::Environment.new('production'))
7
7
  if File.exists?(file)
8
8
  @file = File.expand_path(file)
9
9
  pparser.import(@file)
@@ -45,11 +45,8 @@ class PuppetDocLint
45
45
  rdoc.parts.each do |part|
46
46
  if part.respond_to?(:items)
47
47
  part.items.each do |item|
48
- # Skip rdoc items that aren't paragraphs
49
- next unless (item.parts.to_s.scan("RDoc::Markup::Paragraph") == ["RDoc::Markup::Paragraph"])
50
- # Documentation must be a list - if there's no label then skip
51
48
  next if item.label.nil?
52
- key = item.label.tr('^A-Za-z0-9_-', '')
49
+ key = item.label.to_s.tr('^A-Za-z0-9_-', '')
53
50
  docs[key] = item.parts.first.parts
54
51
  end # do item
55
52
  end # endif
@@ -1,3 +1,3 @@
1
1
  class PuppetDocLint
2
- PUPPETDOCLINT_VERSION = "0.1.1"
2
+ PUPPETDOCLINT_VERSION = "0.2.0"
3
3
  end
@@ -20,8 +20,8 @@ Gem::Specification.new do |gem|
20
20
  gem.add_development_dependency 'rspec', '~> 2.14.1'
21
21
  gem.add_development_dependency 'rake', '~> 10.1.1'
22
22
  gem.add_runtime_dependency 'rdoc', '>=3.12', '<4.0'
23
- gem.add_runtime_dependency 'facter', '~> 1.6'
24
- gem.add_runtime_dependency 'puppet', '~> 3.4.2'
23
+ gem.add_runtime_dependency 'facter'
24
+ gem.add_runtime_dependency 'puppet'
25
25
  gem.add_runtime_dependency 'virtus', '~> 1.0.1'
26
26
 
27
27
 
@@ -0,0 +1,13 @@
1
+ # == Class: foo
2
+ #
3
+ # === Parameters
4
+ #
5
+ # [*ensure*]
6
+ # String. Foo
7
+ # * Bar
8
+ # * Baz
9
+ # * Qux
10
+ #
11
+ class foo ($ensure = false){
12
+
13
+ }
@@ -10,6 +10,7 @@
10
10
  #
11
11
  # [*param_one*]
12
12
  # Param1 documentation text
13
+ #
13
14
  class parameters_rdoc (
14
15
  $param_one = true,
15
16
  $param_two = '',
@@ -70,7 +70,7 @@ describe PuppetDocLint::DocRunner do
70
70
 
71
71
  it "should return a multi-element array" do
72
72
  subject.class.should be(Array)
73
- subject.size.should eql(6)
73
+ subject.size.should eql(7)
74
74
  end
75
75
 
76
76
  end
@@ -1,36 +1,75 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe PuppetDocLint::DocRunner do
4
- file = 'spec/manifests/define_rdoc.pp'
5
- subject { setup(file) }
6
4
 
7
- it 'result should be an array of PuppetDocLint::Result' do
8
- subject.class.should be(Array)
9
- subject[0].class.should be(PuppetDocLint::Result)
10
- end
5
+ context 'define_rdoc' do
11
6
 
12
- it 'file name should be defined' do
13
- subject[0].file_name.should eql 'spec/manifests/define_rdoc.pp'
14
- end
15
-
16
- it 'class should be define_rdoc ' do
17
- subject[0].class_name.should eql 'define_rdoc'
18
- end
7
+ file = 'spec/manifests/define_rdoc.pp'
8
+ subject { setup(file) }
19
9
 
20
- it 'all parameters should be defined' do
21
- subject[0].parameters.should eql ["param_one", "param_two", "param_three", "param_four"]
22
- end
10
+ it 'result should be an array of PuppetDocLint::Result' do
11
+ subject.class.should be(Array)
12
+ subject[0].class.should be(PuppetDocLint::Result)
13
+ end
23
14
 
24
- it 'no documentation is nil' do
25
- subject[0].no_documentation.should be_false
26
- end
15
+ it 'file name should be defined' do
16
+ subject[0].file_name.should eql 'spec/manifests/define_rdoc.pp'
17
+ end
18
+
19
+ it 'class should be define_rdoc ' do
20
+ subject[0].class_name.should eql 'define_rdoc'
21
+ end
22
+
23
+ it 'all parameters should be defined' do
24
+ subject[0].parameters.should eql ["param_one", "param_two", "param_three", "param_four"]
25
+ end
26
+
27
+ it 'no documentation is nil' do
28
+ subject[0].no_documentation.should be_false
29
+ end
30
+
31
+ it 'documented parameters' do
32
+ subject[0].documented_parameters.should eql ["param_one"]
33
+ end
34
+
35
+ it 'undocumented_parameters parameters' do
36
+ subject[0].undocumented_parameters.should eql ["param_two", "param_three", "param_four"]
37
+ end
27
38
 
28
- it 'documented parameters' do
29
- subject[0].documented_parameters.should eql ["param_one"]
30
39
  end
31
40
 
32
- it 'undocumented_parameters parameters' do
33
- subject[0].undocumented_parameters.should eql ["param_two", "param_three", "param_four"]
41
+ context 'define_rdoc' do
42
+ file = 'spec/manifests/nested_bullets.pp'
43
+ subject { setup(file) }
44
+
45
+ it 'result should be an array of PuppetDocLint::Result' do
46
+ subject.class.should be(Array)
47
+ subject[0].class.should be(PuppetDocLint::Result)
48
+ end
49
+
50
+ it 'file name should be defined' do
51
+ subject[0].file_name.should eql "spec/manifests/nested_bullets.pp"
52
+ end
53
+
54
+ it 'class should be foo' do
55
+ subject[0].class_name.should eql 'foo'
56
+ end
57
+
58
+ it 'all parameters should be defined' do
59
+ subject[0].parameters.should eql ["ensure"]
60
+ end
61
+
62
+ it 'no documentation is nil' do
63
+ subject[0].no_documentation.should be_false
64
+ end
65
+
66
+ it 'documented parameters' do
67
+ subject[0].documented_parameters.should eql ["ensure"]
68
+ end
69
+
70
+ it 'undocumented_parameters parameters' do
71
+ subject[0].undocumented_parameters.should eql []
72
+ end
34
73
  end
35
74
 
36
75
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet-doc-lint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Souter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-18 00:00:00.000000000 Z
11
+ date: 2014-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -62,30 +62,30 @@ dependencies:
62
62
  name: facter
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
- - - ~>
65
+ - - '>='
66
66
  - !ruby/object:Gem::Version
67
- version: '1.6'
67
+ version: '0'
68
68
  type: :runtime
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - ~>
72
+ - - '>='
73
73
  - !ruby/object:Gem::Version
74
- version: '1.6'
74
+ version: '0'
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: puppet
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
- - - ~>
79
+ - - '>='
80
80
  - !ruby/object:Gem::Version
81
- version: 3.4.2
81
+ version: '0'
82
82
  type: :runtime
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
- - - ~>
86
+ - - '>='
87
87
  - !ruby/object:Gem::Version
88
- version: 3.4.2
88
+ version: '0'
89
89
  - !ruby/object:Gem::Dependency
90
90
  name: virtus
91
91
  requirement: !ruby/object:Gem::Requirement
@@ -130,6 +130,7 @@ files:
130
130
  - puppet-doc-lint.gemspec
131
131
  - spec/manifests/define_nordoc.pp
132
132
  - spec/manifests/define_rdoc.pp
133
+ - spec/manifests/nested_bullets.pp
133
134
  - spec/manifests/noclass.pp
134
135
  - spec/manifests/noparameters_nordoc.pp
135
136
  - spec/manifests/noparameters_rdoc.pp
@@ -157,13 +158,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
157
158
  version: '0'
158
159
  requirements: []
159
160
  rubyforge_project:
160
- rubygems_version: 2.0.14
161
+ rubygems_version: 2.4.5
161
162
  signing_key:
162
163
  specification_version: 4
163
164
  summary: Doc Parser for Puppet Modules. Returns Information about documentation.
164
165
  test_files:
165
166
  - spec/manifests/define_nordoc.pp
166
167
  - spec/manifests/define_rdoc.pp
168
+ - spec/manifests/nested_bullets.pp
167
169
  - spec/manifests/noclass.pp
168
170
  - spec/manifests/noparameters_nordoc.pp
169
171
  - spec/manifests/noparameters_rdoc.pp