ruby/blog/update_post.rb
# Modifies line in place during the second pass through a file, and writes
# extra output to buffer if necessary.
#
# line should not be written to buffer directly.
Modifies line in place during the second pass through a file, and writes
extra output to buffer if necessary.

line should not be written to buffer directly.
Modifies line in place during the second pass through a file and writes extra output to buffer if necessary . line should not be written to buffer directly .
def parse_line_second_pass(line, buffer)
    if @in_toc
      if line == "\n"
        @in_toc = false
        if not @headlines.empty?
          @headlines[1..@headlines.length].each {|h| buffer.write "#{h}"}
        end
      else
        line.replace ''
      end
    elsif line.start_with? TABLE_OF_CONTENTS
      @in_toc = true
      if not @headlines.empty?  
        line.replace "#{TABLE_OF_CONTENTS}#{@headlines[0]}"
      end
    end
  end
def parse_line_second_pass ( line , buffer ) if @in_toc if line == "\n" @in_toc = false if not @headlines . empty? @headlines [ 1 .. @headlines . length ] . each { | h | buffer . write "#{h}" } end else line . replace '' end elsif line . start_with? TABLE_OF_CONTENTS @in_toc = true if not @headlines . empty? line . replace "#{TABLE_OF_CONTENTS}#{@headlines[0]}" end end end
Modifies line in place during the second pass through a file, and writes
extra output to buffer if necessary.
Modifies line in place during the second pass through a file and writes extra output to buffer if necessary .
line
<not_specific>
buffer
<not_specific>