Class: ReVIEW::Preprocessor::Strip

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

Instance Method Summary collapse

Constructor Details

#initialize(f) ⇒ Strip

Returns a new instance of Strip.



63
64
65
# File 'lib/review/preprocessor.rb', line 63

def initialize(f)
  @f = f
end

Instance Method Details

#eachObject



86
87
88
89
90
# File 'lib/review/preprocessor.rb', line 86

def each
  @f.each do |line|
    yield line unless /\A\#@/ =~ line
  end
end

#getsObject



75
76
77
78
79
80
81
82
83
84
# File 'lib/review/preprocessor.rb', line 75

def gets
  while line = @f.gets
    if /\A\#@/ =~ line
      return "\#@\#\n"
    else
      return line
    end
  end
  nil
end

#linenoObject



71
72
73
# File 'lib/review/preprocessor.rb', line 71

def lineno
  @f.lineno
end

#pathObject



67
68
69
# File 'lib/review/preprocessor.rb', line 67

def path
  @f.path
end