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.



77
78
79
# File 'lib/review/preprocessor.rb', line 77

def initialize(f)
  @f = f
end

Instance Method Details

#eachObject



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

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

#getsObject



89
90
91
92
93
94
95
96
97
98
# File 'lib/review/preprocessor.rb', line 89

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

#linenoObject



85
86
87
# File 'lib/review/preprocessor.rb', line 85

def lineno
  @f.lineno
end

#pathObject



81
82
83
# File 'lib/review/preprocessor.rb', line 81

def path
  @f.path
end