Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Change PuppetLint @data to @code

  • Loading branch information...
commit 0e0e15750ce65301728a4c4800f46f0b95d0f6e7 1 parent 1fbd454
@rodjek authored
Showing with 6 additions and 10 deletions.
  1. +5 −9 lib/puppet-lint.rb
  2. +1 −1  spec/puppet-lint_spec.rb
View
14 lib/puppet-lint.rb
@@ -8,10 +8,10 @@
class PuppetLint::NoCodeError < StandardError; end
class PuppetLint
- attr_reader :data
+ attr_accessor :code
def initialize
- @data = nil
+ @code = nil
@statistics = {:error => 0, :warning => 0}
@fileinfo = {:path => ''}
end
@@ -29,14 +29,10 @@ def file=(path)
@fileinfo[:path] = path
@fileinfo[:fullpath] = File.expand_path(path)
@fileinfo[:filename] = File.basename(path)
- @data = File.read(path)
+ @code = File.read(path)
end
end
- def code=(value)
- @data = value
- end
-
def log_format
if configuration.log_format == ''
## recreate previous old log format as far as thats possible.
@@ -87,12 +83,12 @@ def warnings?
end
def run
- if @data.nil?
+ if @code.nil?
raise PuppetLint::NoCodeError
end
linter = PuppetLint::Checks.new
- problems = linter.run(@fileinfo, @data)
+ problems = linter.run(@fileinfo, @code)
report problems, linter
end
end
View
2  spec/puppet-lint_spec.rb
@@ -5,7 +5,7 @@
it 'should accept manifests as a string' do
subject.code = "class foo { }"
- subject.data.should_not be_nil
+ subject.code.should_not be_nil
end
it 'should have support for % with a hash' do
Please sign in to comment.
Something went wrong with that request. Please try again.