puppet-lint 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/lib/puppet-lint.rb CHANGED
@@ -5,7 +5,7 @@ require 'puppet'
5
5
  class PuppetLint::NoCodeError < StandardError; end
6
6
 
7
7
  class PuppetLint
8
- VERSION = '0.1.0'
8
+ VERSION = '0.1.1'
9
9
 
10
10
  attr_reader :code, :file
11
11
 
@@ -75,7 +75,7 @@ class PuppetLint::Plugins::CheckClasses < PuppetLint::CheckPlugin
75
75
 
76
76
  (class_indexes + defined_type_indexes).each do |idx|
77
77
  object_tokens = tokens[idx[:start]..idx[:end]]
78
- variables_in_scope = []
78
+ variables_in_scope = ['name']
79
79
  referenced_variables = []
80
80
  header_end_idx = object_tokens.index { |r| r.first == :LBRACE }
81
81
  lparen_idx = object_tokens[0..header_end_idx].index { |r| r.first == :LPAREN }
data/puppet-lint.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'puppet-lint'
3
- s.version = '0.1.0'
3
+ s.version = '0.1.1'
4
4
  s.homepage = 'https://github.com/rodjek/puppet-lint/'
5
5
  s.summary = 'Ensure your Puppet manifests conform with the Puppetlabs style guide'
6
6
  s.description = 'Checks your Puppet manifests against the Puppetlabs
@@ -160,4 +160,15 @@ describe PuppetLint::Plugins::CheckClasses do
160
160
  its(:warnings) { should be_empty }
161
161
  its(:errors) { should be_empty }
162
162
  end
163
+
164
+ describe '$name should be auto defined' do
165
+ let(:code) { "
166
+ define foo() {
167
+ $bar = $name
168
+ }"
169
+ }
170
+
171
+ its(:warnings) { should be_empty }
172
+ its(:errors) { should be_empty }
173
+ end
163
174
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet-lint
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tim Sharpe
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-08-23 00:00:00 Z
18
+ date: 2011-09-07 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rspec