Class: ReVIEW::Retrovert::Preprocessor

Inherits:
Object
  • Object
show all
Defined in:
lib/review/retrovert/reviewcompat.rb

Instance Method Summary collapse

Constructor Details

#initialize(param) ⇒ Preprocessor

Returns a new instance of Preprocessor.



8
9
10
11
12
13
14
# File 'lib/review/retrovert/reviewcompat.rb', line 8

def initialize(param)
  if Gem::Version.new(ReVIEW::VERSION) >= Gem::Version.new('5.2.0')
    @preprocessor = ReVIEW::Preprocessor.new(param)
  else
    @preprocessor = ReVIEW::Preprocessor.new(ReVIEW::Repository.new(param), param)
  end
end

Instance Method Details

#process(path) ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'lib/review/retrovert/reviewcompat.rb', line 16

def process(path)
  if Gem::Version.new(ReVIEW::VERSION) >= Gem::Version.new('5.2.0')
    @preprocessor.process(path)
  else
    buf = StringIO.new
    File.open(path) { |f| @preprocessor.process(f, buf) }
    buf.string
  end
end