class Codeqa::Checker

Attributes

errors[R]
sourcefile[R]

Public Class Methods

available?() click to toggle source
# File lib/codeqa/checker.rb, line 19
def self.available?
  true
end
new(sourcefile) click to toggle source
# File lib/codeqa/checker.rb, line 10
def initialize(sourcefile)
  @errors = CheckErrors.new
  @sourcefile = sourcefile
end

Private Instance Methods

with_existing_file(content=sourcefile.content) { |filename| ... } click to toggle source
# File lib/codeqa/checker.rb, line 25
def with_existing_file(content=sourcefile.content)
  if sourcefile.exist? && sourcefile.content == content
    yield sourcefile.filename
  else
    Tempfile.open('codeqa') do |tmpfile|
      tmpfile.write(content)
      tmpfile.flush
      tmpfile.rewind
      yield tmpfile.path
    end
  end
end