Tool (Class)

In: rtex.rb
Parent: Object

This class defines some generic methods. This methods must be implemented by each tool which is needed. The different tools can be:

  • LaTeX itself (or pdfLaTeX…)
  • makeindex (or yindy…)
  • bibtex
  • rail

Each tool must implement:

  • rerun? : Return true or false
  • execute: runs the tool, returning true or false. False is a hard error, stopping the further processing
        This method should call execute_tools (not necessary, if @tools is empty)
    
  • analyse: Return a hash with number of errors, warnings… errorlist…

A tool may require other tools (LaTeX need BibTeX, Makeindex…) This tools are in array @tools.

Public Class methods

Return a list with instances of the tool. By default it is one instance. Some tools determine more instances, e.g. makeindex, if there are multiple indeces.

Write a finishing statistic with all results of the last run.

Each tool requires one input file.

 Takes the result and displays it. Rules for the display:
  • First summary if available
  • Only arguments with a value > 0 (Zero error is not reported)
  • List with Error/Warnings are attached

Public Instance methods

Add the result of stderr to the log-File

Method to analyse a log-File (or whatever the tool creates to be analysed) Returns a hash with summary of errors/warnings…

The following methods must not be redefined by the specific tools

Execute the tool

Execute all tools in @tools and return true if the data changed, so an additional call is necessary

Add the result of stdout to the log-File

Each object gets an ID, default is the class. If a tool has more instances, other names are given (e.g name of index).

Object-method for Class-method (easier to call)

Generall method to read a file.

This Method defines a check, if an additional run is necessary

STDERR is temporary redirected to a file.

Stdout is coming again to the screen.

STDOUT is temporary redirected to a file.

Stdout is coming again to the screen.

[Validate]