Class: ReVIEW::Preprocessor

Inherits:
Object show all
Includes:
ErrorUtils
Defined in:
lib/review/preprocessor.rb

Defined Under Namespace

Classes: Directive, Strip

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ErrorUtils

#error, #filename, #init_ErrorUtils, #lineno, #location, #warn

Constructor Details

#initialize(repo, param) ⇒ Preprocessor

Returns a new instance of Preprocessor.



93
94
95
96
# File 'lib/review/preprocessor.rb', line 93

def initialize(repo, param)
  @repository = repo
  @config = param
end

Class Method Details

.strip(f) ⇒ Object



54
55
56
57
58
59
60
# File 'lib/review/preprocessor.rb', line 54

def Preprocessor.strip(f)
  buf = ''
  Strip.new(f).each do |line|
    buf << line.rstrip << "\n"
  end
  buf
end

Instance Method Details

#process(inf, outf) ⇒ Object



98
99
100
101
102
103
104
105
106
# File 'lib/review/preprocessor.rb', line 98

def process(inf, outf)
  init_ErrorUtils inf
  @f = outf
  begin
    preproc inf
  rescue Errno::ENOENT => err
    error err.message
  end
end