puppet-ghostbuster 0.4.0 → 0.4.1

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: 65c4533a993b62ad0194d46774be738437de8a38
4
- data.tar.gz: d68124e057a0aee869af77cbf7923b8d3a47eaa3
3
+ metadata.gz: fe3d424e7d8e045262acebbde7420fe8da3e00a6
4
+ data.tar.gz: c7cced00812e60526b634819c5adb054ea8bb444
5
5
  SHA512:
6
- metadata.gz: af14464b230b01dbde502d0f69f94d0be802ade503bf0067d660f557189419388534e2f936438a0249d480447ba2384a399a60c383530dfad2bcc2c9ff7319e7
7
- data.tar.gz: 2884410e432f51d41c39bcb0f2e21cd164f788de919dd66c7057bc4842ac1bb71be20e90699140c0f78de96459d7958a1811077c653c46aed6956dbc8dbf434f
6
+ metadata.gz: 03b601bcf25c8fc053370f4a91f23c94e2422c94406045879617899ec75dc562d6051bb0b6e6e4f7a8dbe90f5579bc2be6e447f99195f3acd472d17c30b824c6
7
+ data.tar.gz: 11bb6306ee9dccc67810af7b8d12c71a2a8584d3830fa4d051fb9ec01d31416191907a9cbe2adcb341a5995d393384714962c5d83afb3c2e2a4488ef5246a8de
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Change Log
2
2
 
3
+ ## [0.4.1](https://rubygems.org/gems/puppet-ghostbuster/versions/0.4.1) (2016-05-02)
4
+ [Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.4.0...0.4.1)
5
+
6
+ **Fixed bugs:**
7
+
8
+ - Fix unused files detection[\#20](https://github.com/camptocamp/puppet-ghostbuster/pull/20) ([mcanevet](https://github.com/mcanevet))
9
+
3
10
  ## [0.4.0](https://rubygems.org/gems/puppet-ghostbuster/versions/0.4.0) (2016-04-28)
4
11
  [Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.3.0...0.4.0)
5
12
 
@@ -1,3 +1,3 @@
1
1
  class PuppetGhostbuster
2
- VERSION = '0.4.0'
2
+ VERSION = '0.4.1'
3
3
  end
@@ -147,20 +147,18 @@ class PuppetGhostbuster
147
147
  next unless File.file?(file)
148
148
  module_name, file_name = file.match(/.*\/([^\/]+)\/files\/(.+)$/).captures
149
149
  count = 0
150
- Dir["#{path}"].each do |caller_file|
151
- next unless File.file?(caller_file)
152
- begin
153
- if caller_file =~ /\.pp$/
154
- if match = caller_file.match(/.*\/([^\/]+)\/manifests\/.+$/)
155
- manifest_module_name = match.captures[0]
156
- if manifest_module_name == module_name
157
- count += File.readlines(caller_file).grep(/["']\$\{module_name\}\/#{file_name}["']/).size
158
- end
159
- end
150
+ manifests.each do |manifest|
151
+ if File.symlink?(manifest)
152
+ @@logger.warn " Skipping symlink #{manifest}"
153
+ next
154
+ end
155
+ if match = caller_file.match(/.*\/([^\/]+)\/manifests\/.+$/)
156
+ manifest_module_name = match.captures[0]
157
+ if manifest_module_name == module_name
158
+ count += File.readlines(caller_file).grep(/["']\$\{module_name\}\/#{file_name}["']/).size
160
159
  end
161
- count += File.readlines(caller_file).grep(/#{module_name}\/#{file_name}/).size
162
- rescue ArgumentError
163
160
  end
161
+ count += File.readlines(caller_file).grep(/#{module_name}\/#{file_name}/).size
164
162
  end
165
163
  @@issues << { :title => "[GhostBuster] File #{module_name}/#{file_name} seems unused", :body => file } if count == 0
166
164
  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.0
4
+ version: 0.4.1
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-28 00:00:00.000000000 Z
11
+ date: 2016-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: coveralls