Method: RunTeX::Makeindex#analyse_log

Defined in:
lib/runtex_makeindex.rb

#analyse_log(logdata) ⇒ Object

Analyse the makeindex-log



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/runtex_makeindex.rb', line 81

def analyse_log( logdata )
  @job.log.debug( "#{@step} Analyse log-file") if @job.log.debug?
  result = {  
          :error    => [],
          #~ :warning => [],

          :info => [],
          :rejected => 0,
      }
  error = nil
  logdata.each{ |logline|
    if error  #Index error

      result[:error] << "#{logline.chomp.sub(/.*--/, "")} #{error}"
      error = nil
    else
      case logline
      when /Scanning input file (.*)\...done \((.*) entries accepted, (.*) rejected\)./
        result[:info] << "input file #{$1} (#{$2} entries accepted, #{$3} rejected)"
      when /done \((.*) entries accepted, (.*) rejected\)./
        result[:rejected] += $2.to_i() if $2.to_i() > 0
      when /!! Input index error \(file = (.*), line = (.*)\):/
        #Error-message on next line

        error = "(file #{$1} line #{$2}: #{logline})"
      end #case logline

    end #if error

  }
  result[:error] << "#{logline.chomp.sub(/.*--/, "")} #{error}" if error
  return result
end