puppet-ghostbuster 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/puppet-ghostbuster/version.rb +1 -1
- data/lib/puppet-ghostbuster.rb +16 -1
- 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: e640683fdc2081827655309a5b74b8789f64fc0b
|
4
|
+
data.tar.gz: 35dc19ede6aead0efa888b524bf8cfa7e82f33a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f371c80c10c50346e92f7f26a4d6c34aa986fb43a261475c873d9c05bfa028e107188cb642935270850a6a2253ae78c82d383afb583649b9fc2a96f09e4fe362
|
7
|
+
data.tar.gz: 5183186cf01b3c9bb5be41f3321113cd9b8df23d21139ac9295a11de7f8a245252616758cf56455af633b28777a1a3f39c13a773351ad0b68a20fca6f4c29c1a
|
data/lib/puppet-ghostbuster.rb
CHANGED
@@ -51,7 +51,7 @@ class PuppetGhostbuster
|
|
51
51
|
|
52
52
|
def initialize
|
53
53
|
Puppet.initialize_settings
|
54
|
-
Dir["
|
54
|
+
Dir["./**/manifests/**/*.pp"].each do |file|
|
55
55
|
if c = File.readlines(file).grep(/^class\s+([^\s\(\{]+)/){$1}[0]
|
56
56
|
class_name = c.split('::').map(&:capitalize).join('::')
|
57
57
|
count = self.class.used_classes.select { |klass| klass == class_name }.size
|
@@ -62,6 +62,21 @@ class PuppetGhostbuster
|
|
62
62
|
puts "#{count} #{define_name}"
|
63
63
|
end
|
64
64
|
end
|
65
|
+
Dir['./**/templates/*'].each do |template|
|
66
|
+
next unless File.file?(template)
|
67
|
+
module_name, template_name = template.match(/.*\/([^\/]+)\/templates\/(.+)$/).captures
|
68
|
+
found = false
|
69
|
+
Dir["./**/manifests/**/*.pp"].each do |manifest|
|
70
|
+
if match = manifest.match(/.*\/([^\/]+)\/manifests\/.+$/)
|
71
|
+
manifest_module_name = match.captures[0]
|
72
|
+
found = File.readlines(manifest).grep(/["']\$\{module_name\}\/#{template_name}["']/).size > 0 if manifest_module_name == module_name
|
73
|
+
break if found
|
74
|
+
end
|
75
|
+
found = File.readlines(manifest).grep(/["']#{module_name}\/#{template_name}["']/).size > 0
|
76
|
+
break if found
|
77
|
+
end
|
78
|
+
puts "#{template} not used" unless found
|
79
|
+
end
|
65
80
|
end
|
66
81
|
|
67
82
|
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.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Camptocamp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|