puppet-ghostbuster 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +39 -14
- data/lib/puppet-ghostbuster/version.rb +1 -1
- data/lib/puppet-ghostbuster.rb +6 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 65c4533a993b62ad0194d46774be738437de8a38
|
4
|
+
data.tar.gz: d68124e057a0aee869af77cbf7923b8d3a47eaa3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af14464b230b01dbde502d0f69f94d0be802ade503bf0067d660f557189419388534e2f936438a0249d480447ba2384a399a60c383530dfad2bcc2c9ff7319e7
|
7
|
+
data.tar.gz: 2884410e432f51d41c39bcb0f2e21cd164f788de919dd66c7057bc4842ac1bb71be20e90699140c0f78de96459d7958a1811077c653c46aed6956dbc8dbf434f
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## [0.4.0](https://rubygems.org/gems/puppet-ghostbuster/versions/0.4.0) (2016-04-28)
|
4
|
+
[Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.3.0...0.4.0)
|
5
|
+
|
6
|
+
**Implemented enhancements:**
|
7
|
+
|
8
|
+
- Output to JSON[\#17](https://github.com/camptocamp/puppet-ghostbuster/pull/17) ([mcanevet](https://github.com/mcanevet))
|
9
|
+
|
3
10
|
## [0.3.0](https://rubygems.org/gems/puppet-ghostbuster/versions/0.3.0) (2016-04-26)
|
4
11
|
[Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.2.1...0.3.0)
|
5
12
|
|
data/README.md
CHANGED
@@ -29,20 +29,45 @@ You can add preconnect command with ``-p`` and server url with ``-s``.
|
|
29
29
|
Example output
|
30
30
|
--------------
|
31
31
|
```
|
32
|
-
$
|
33
|
-
|
34
|
-
|
35
|
-
Class Foo
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
32
|
+
$ puppet-ghostbuster -s https://puppetdburl:8081 | jsonpp
|
33
|
+
[
|
34
|
+
{
|
35
|
+
"title": "[GhostBuster] Class Foo::Install seems unused",
|
36
|
+
"body": "./modules/foo/manifests/install.pp"
|
37
|
+
},
|
38
|
+
{
|
39
|
+
"title": "[GhostBuster] Class Foo::Service seems unused",
|
40
|
+
"body": "./modules/foo/manifests/service.pp"
|
41
|
+
},
|
42
|
+
{
|
43
|
+
"title": "[GhostBuster] Class Foo seems unused",
|
44
|
+
"body": "./modules/foo/manifests/init.pp"
|
45
|
+
},
|
46
|
+
{
|
47
|
+
"title": "[GhostBuster] Define Bar:Baz seems unused",
|
48
|
+
"body": "./modules/bar/manifests/baz.pp"
|
49
|
+
},
|
50
|
+
{
|
51
|
+
"title": "[GhostBuster] Template modulename/foo.erb seems unused",
|
52
|
+
"body": "./modules/modulename/templates/foo.erb"
|
53
|
+
},
|
54
|
+
{
|
55
|
+
"title": "[GhostBuster] Template modulename/bar.erb seems unused",
|
56
|
+
"body": "./modules/modulename/templates/bar.erb"
|
57
|
+
},
|
58
|
+
{
|
59
|
+
"title": "[GhostBuster] Template modulename/baz.erb seems unused",
|
60
|
+
"body": "./modules/modulename/templates/baz.erb"
|
61
|
+
},
|
62
|
+
{
|
63
|
+
"title": "[GhostBuster] File foo/bar.txt seems unused",
|
64
|
+
"body": "./modules/foo/files/bar.txt"
|
65
|
+
},
|
66
|
+
{
|
67
|
+
"title": "[GhostBuster] File foo/baz.txt seems unused",
|
68
|
+
"body": "./modules/foo/files/baz.txt"
|
69
|
+
}
|
70
|
+
]
|
46
71
|
```
|
47
72
|
|
48
73
|
How It Works
|
data/lib/puppet-ghostbuster.rb
CHANGED
@@ -10,6 +10,7 @@ require 'puppet-ghostbuster/configuration'
|
|
10
10
|
class PuppetGhostbuster
|
11
11
|
|
12
12
|
attr_accessor :path
|
13
|
+
@@issues = []
|
13
14
|
|
14
15
|
def exclude(filelist)
|
15
16
|
ignorefile = "#{path}/.ghostbusterignore"
|
@@ -99,7 +100,7 @@ class PuppetGhostbuster
|
|
99
100
|
if c = File.readlines(file).grep(/^class\s+([^\s\(\{]+)/){$1}[0]
|
100
101
|
class_name = c.split('::').map(&:capitalize).join('::')
|
101
102
|
count = self.class.used_classes.select { |klass| klass == class_name }.size
|
102
|
-
|
103
|
+
@@issues << { :title => "[GhostBuster] Class #{class_name} seems unused", :body => file } if count == 0
|
103
104
|
end
|
104
105
|
end
|
105
106
|
end
|
@@ -114,7 +115,7 @@ class PuppetGhostbuster
|
|
114
115
|
if d = File.readlines(file).grep(/^define\s+([^\s\(\{]+)/){$1}[0]
|
115
116
|
define_name = d.split('::').map(&:capitalize).join('::')
|
116
117
|
count = self.class.client.request('resources', [:'=', 'type', define_name]).data.size
|
117
|
-
|
118
|
+
@@issues << { :title => "[GhostBuster] Define #{define_name} seems unused", :body => file } if count == 0
|
118
119
|
end
|
119
120
|
end
|
120
121
|
end
|
@@ -136,7 +137,7 @@ class PuppetGhostbuster
|
|
136
137
|
end
|
137
138
|
count += File.readlines(manifest).grep(/["']#{module_name}\/#{template_name}["']/).size
|
138
139
|
end
|
139
|
-
|
140
|
+
@@issues << { :title => "[GhostBuster] Template #{module_name}/#{template_name} seems unused", :body => template } if count == 0
|
140
141
|
end
|
141
142
|
end
|
142
143
|
|
@@ -161,7 +162,7 @@ class PuppetGhostbuster
|
|
161
162
|
rescue ArgumentError
|
162
163
|
end
|
163
164
|
end
|
164
|
-
|
165
|
+
@@issues << { :title => "[GhostBuster] File #{module_name}/#{file_name} seems unused", :body => file } if count == 0
|
165
166
|
end
|
166
167
|
end
|
167
168
|
|
@@ -178,6 +179,7 @@ class PuppetGhostbuster
|
|
178
179
|
find_unused_defines
|
179
180
|
find_unused_templates
|
180
181
|
find_unused_files
|
182
|
+
puts @@issues.to_json
|
181
183
|
end
|
182
184
|
|
183
185
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet-ghostbuster
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Camptocamp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: coveralls
|