puppet-ghostbuster 0.7.1 → 0.7.2

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: a78a0b11c9950a7bd0ee29f97d952fa7fedcf1ac
4
- data.tar.gz: 9063dd63354c9ee624e9337d155c800a7391bf03
3
+ metadata.gz: 8b2e06b759612d9b773d0d6eb3efaef0b91acc36
4
+ data.tar.gz: c38603601072ff8cbb8a7dae4ffd44fd26965091
5
5
  SHA512:
6
- metadata.gz: cf75180a7a7f695c88b81bf72d703064805e539bf59dca5445fe8cb9257ef23012a7f9ed47d667fd0f16d56e1b3f578f7adb0c070837ec517aa838d6c97f12db
7
- data.tar.gz: a3f9e6efcfe9d34f1e050e5721b61cc6d771a1d77db627c27f022e24c6e73bde4ed46be15c9345ca11f647d3d574a5a1192056e18489c70ea350f3eaaafbf162
6
+ metadata.gz: aa349856ba8787af3b7aea3bd2640cd73e571b7ea459d87108f48d0c85bf8a7562724dca6d47e6978fd735def66ee34e4c5c5efafed48986e24deb18474d4744
7
+ data.tar.gz: d396dee2c8f039f3b6a41a4af415b642b0a5d8db916f502b591c27f3610cbb2f104ae186d77863f1d64460186385b3651c37f17274b9e9e9f1c2ffbe327fec16
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Change Log
2
2
 
3
+ ## [0.7.2](https://rubygems.org/gems/puppet-ghostbuster/versions/0.7.2) (2016-05-19)
4
+ [Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.7.1...0.7.2)
5
+
6
+ **Fixed bugs:**
7
+
8
+ - Detect facts used in inline_templates()
9
+
3
10
  ## [0.7.1](https://rubygems.org/gems/puppet-ghostbuster/versions/0.7.1) (2016-05-16)
4
11
  [Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.7.0...0.7.1)
5
12
 
@@ -1,3 +1,3 @@
1
1
  class PuppetGhostbuster
2
- VERSION = '0.7.1'
2
+ VERSION = '0.7.2'
3
3
  end
@@ -1,5 +1,19 @@
1
1
  require 'puppet-ghostbuster/puppetdb'
2
2
 
3
+ class PuppetLint::Checks
4
+ def load_data(path, content)
5
+ lexer = PuppetLint::Lexer.new
6
+ PuppetLint::Data.path = path
7
+ begin
8
+ PuppetLint::Data.manifest_lines = content.split("\n", -1)
9
+ PuppetLint::Data.tokens = lexer.tokenise(content)
10
+ PuppetLint::Data.parse_control_comments
11
+ rescue
12
+ PuppetLint::Data.tokens = []
13
+ end
14
+ end
15
+ end
16
+
3
17
  PuppetLint.new_check(:ghostbuster_classes) do
4
18
  def check
5
19
  return if path.match(%r{^\./(:?[^/]+/){2}?manifests/.+$}).nil?
@@ -1,5 +1,19 @@
1
1
  require 'puppet-ghostbuster/puppetdb'
2
2
 
3
+ class PuppetLint::Checks
4
+ def load_data(path, content)
5
+ lexer = PuppetLint::Lexer.new
6
+ PuppetLint::Data.path = path
7
+ begin
8
+ PuppetLint::Data.manifest_lines = content.split("\n", -1)
9
+ PuppetLint::Data.tokens = lexer.tokenise(content)
10
+ PuppetLint::Data.parse_control_comments
11
+ rescue
12
+ PuppetLint::Data.tokens = []
13
+ end
14
+ end
15
+ end
16
+
3
17
  PuppetLint.new_check(:ghostbuster_defines) do
4
18
  def check
5
19
  return if path.match(%r{^\./(:?[^/]+/){2}?manifests/.+$}).nil?
@@ -1,3 +1,17 @@
1
+ class PuppetLint::Checks
2
+ def load_data(path, content)
3
+ lexer = PuppetLint::Lexer.new
4
+ PuppetLint::Data.path = path
5
+ begin
6
+ PuppetLint::Data.manifest_lines = content.split("\n", -1)
7
+ PuppetLint::Data.tokens = lexer.tokenise(content)
8
+ PuppetLint::Data.parse_control_comments
9
+ rescue
10
+ PuppetLint::Data.tokens = []
11
+ end
12
+ end
13
+ end
14
+
1
15
  PuppetLint.new_check(:ghostbuster_facts) do
2
16
  def manifests
3
17
  Dir.glob('./**/manifests/**/*.pp')
@@ -18,6 +32,7 @@ PuppetLint.new_check(:ghostbuster_facts) do
18
32
 
19
33
  manifests.each do |manifest|
20
34
  found = true if File.readlines(manifest).grep(%r{\$\{?::#{fact_name}\}?}).size > 0
35
+ found = true if File.readlines(manifest).grep(%r{@#{fact_name}}).size > 0
21
36
  break if found
22
37
  end
23
38
 
@@ -1,3 +1,17 @@
1
+ class PuppetLint::Checks
2
+ def load_data(path, content)
3
+ lexer = PuppetLint::Lexer.new
4
+ PuppetLint::Data.path = path
5
+ begin
6
+ PuppetLint::Data.manifest_lines = content.split("\n", -1)
7
+ PuppetLint::Data.tokens = lexer.tokenise(content)
8
+ PuppetLint::Data.parse_control_comments
9
+ rescue
10
+ PuppetLint::Data.tokens = []
11
+ end
12
+ end
13
+ end
14
+
1
15
  PuppetLint.new_check(:ghostbuster_functions) do
2
16
  def manifests
3
17
  Dir.glob('./**/manifests/**/*.pp')
@@ -1,3 +1,17 @@
1
+ class PuppetLint::Checks
2
+ def load_data(path, content)
3
+ lexer = PuppetLint::Lexer.new
4
+ PuppetLint::Data.path = path
5
+ begin
6
+ PuppetLint::Data.manifest_lines = content.split("\n", -1)
7
+ PuppetLint::Data.tokens = lexer.tokenise(content)
8
+ PuppetLint::Data.parse_control_comments
9
+ rescue
10
+ PuppetLint::Data.tokens = []
11
+ end
12
+ end
13
+ end
14
+
1
15
  PuppetLint.new_check(:ghostbuster_hiera_files) do
2
16
 
3
17
  def regexprs
@@ -1,5 +1,19 @@
1
1
  require 'puppet-ghostbuster/puppetdb'
2
2
 
3
+ class PuppetLint::Checks
4
+ def load_data(path, content)
5
+ lexer = PuppetLint::Lexer.new
6
+ PuppetLint::Data.path = path
7
+ begin
8
+ PuppetLint::Data.manifest_lines = content.split("\n", -1)
9
+ PuppetLint::Data.tokens = lexer.tokenise(content)
10
+ PuppetLint::Data.parse_control_comments
11
+ rescue
12
+ PuppetLint::Data.tokens = []
13
+ end
14
+ end
15
+ end
16
+
3
17
  PuppetLint.new_check(:ghostbuster_types) do
4
18
  def manifests
5
19
  Dir.glob('./**/manifests/**/*.pp')
@@ -0,0 +1,6 @@
1
+ # Fact used in inline_template
2
+ Facter.add('quux') do
3
+ setcode do
4
+ 'quux'
5
+ end
6
+ end
@@ -16,4 +16,7 @@ class foo::bar {
16
16
  }
17
17
  $foo = bar('baz')
18
18
  bar { 'bar': }
19
+ file { 'quux':
20
+ content => inline_template('<%= @quux %>'),
21
+ }
19
22
  }
@@ -44,5 +44,13 @@ describe 'ghostbuster_facts' do
44
44
  expect(problems).to have(0).problems
45
45
  end
46
46
  end
47
+
48
+ context 'when fact is used in an inline_template' do
49
+ let(:path) { "./spec/fixtures/modules/foo/lib/facter/quux.rb" }
50
+
51
+ it 'should not detect any problem' do
52
+ expect(problems).to have(0).problems
53
+ end
54
+ end
47
55
  end
48
56
  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.7.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Camptocamp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-16 00:00:00.000000000 Z
11
+ date: 2016-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: coveralls
@@ -193,6 +193,7 @@ files:
193
193
  - spec/fixtures/modules/foo/lib/facter/baz.rb
194
194
  - spec/fixtures/modules/foo/lib/facter/foo.rb
195
195
  - spec/fixtures/modules/foo/lib/facter/multi.rb
196
+ - spec/fixtures/modules/foo/lib/facter/quux.rb
196
197
  - spec/fixtures/modules/foo/lib/puppet/parser/functions/bar.rb
197
198
  - spec/fixtures/modules/foo/lib/puppet/parser/functions/baz.rb
198
199
  - spec/fixtures/modules/foo/lib/puppet/parser/functions/foo.rb