Class: Rdefs::Preprocessor

Inherits:
Object
  • Object
show all
Defined in:
lib/rdefs.rb

Instance Method Summary collapse

Constructor Details

#initialize(f) ⇒ Preprocessor

Returns a new instance of Preprocessor.



25
26
27
# File 'lib/rdefs.rb', line 25

def initialize(f)
  @f = f
end

Instance Method Details

#gets ⇒ Object



29
30
31
32
33
34
35
36
37
38
# File 'lib/rdefs.rb', line 29

def gets
  line = @f.gets
  if /^=begin\s/ =~ line
    while line = @f.gets
      break if /^=end\s/ =~ line
    end
    line = @f.gets
  end
  line
end

#lineno ⇒ Object



40
41
42
# File 'lib/rdefs.rb', line 40

def lineno
  @f.lineno
end