puppet-lint 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,7 +18,8 @@ require 'rubygems'
18
18
  require 'puppet-lint'
19
19
 
20
20
  options = {
21
- :error_level => :all,
21
+ :error_level => :all,
22
+ :with_filename => false,
22
23
  }
23
24
  opts = OptionParser.new do |opts|
24
25
  opts.banner = help
@@ -59,7 +60,6 @@ end
59
60
  begin
60
61
  l = PuppetLint.new(options)
61
62
  l.file = ARGV[0]
62
- l.show_filename = options.has_key?(:with_filename) ? options[:with_filename] : false
63
63
  l.run
64
64
 
65
65
  if l.errors? or (l.warnings? and options[:fail_on_warnings])
@@ -21,22 +21,22 @@ end
21
21
  class PuppetLint::NoCodeError < StandardError; end
22
22
 
23
23
  class PuppetLint
24
- VERSION = '0.1.8'
24
+ VERSION = '0.1.9'
25
25
 
26
- attr_reader :code, :file, :show_filename
26
+ attr_reader :code, :file
27
27
 
28
28
  def initialize(options)
29
29
  @data = nil
30
30
  @errors = 0
31
31
  @warnings = 0
32
- @show_filename = 0
32
+ @with_filename = options[:with_filename]
33
33
  @path = ''
34
34
  @error_level = options[:error_level]
35
35
  end
36
36
 
37
37
  def file=(path)
38
38
  if File.exist? path
39
- @path = path
39
+ @path = File.expand_path(path)
40
40
  @data = File.read(path)
41
41
  end
42
42
  end
@@ -45,10 +45,6 @@ class PuppetLint
45
45
  @data = value
46
46
  end
47
47
 
48
- def show_filename=(value)
49
- @show_filename = value
50
- end
51
-
52
48
  def report(kind, message)
53
49
  #msg = message
54
50
  if kind == :warnings
@@ -58,7 +54,7 @@ class PuppetLint
58
54
  @errors += 1
59
55
  message.prepend('ERROR: ')
60
56
  end
61
- if @show_filename
57
+ if @with_filename
62
58
  message.prepend("#{@path} - ")
63
59
  end
64
60
  puts message
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'puppet-lint'
3
- s.version = '0.1.8'
3
+ s.version = '0.1.9'
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
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: 11
4
+ hash: 9
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 8
10
- version: 0.1.8
9
+ - 9
10
+ version: 0.1.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tim Sharpe