Class: LatexFlow::Tools::Generic

Inherits:
Object
  • Object
show all
Defined in:
lib/latex-flow/tools/generic.rb

Direct Known Subclasses

Tools::BibTeX, Tools::Dvipdfm, Tools::LaTeX

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command) ⇒ Generic

Returns a new instance of Generic.



9
10
11
# File 'lib/latex-flow/tools/generic.rb', line 9

def initialize(command)
  @command = command
end

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command.



7
8
9
# File 'lib/latex-flow/tools/generic.rb', line 7

def command
  @command
end

#processObject (readonly)

Returns the value of attribute process.



7
8
9
# File 'lib/latex-flow/tools/generic.rb', line 7

def process
  @process
end

#stderrObject (readonly)

Returns the value of attribute stderr.



7
8
9
# File 'lib/latex-flow/tools/generic.rb', line 7

def stderr
  @stderr
end

#stdoutObject (readonly)

Returns the value of attribute stdout.



7
8
9
# File 'lib/latex-flow/tools/generic.rb', line 7

def stdout
  @stdout
end

Instance Method Details

#messages(color: false) ⇒ Object



37
38
39
# File 'lib/latex-flow/tools/generic.rb', line 37

def messages(color:false)
  color ? messages_with_color : @stdout + $/ + @stderr
end

#messages_with_colorObject



41
42
43
# File 'lib/latex-flow/tools/generic.rb', line 41

def messages_with_color
  @stdout + $/ + @stderr
end

#runObject



13
14
15
# File 'lib/latex-flow/tools/generic.rb', line 13

def run
  @process, @stdout, @stderr = systemu(@command)
end

#stderr_with_colorObject



33
34
35
# File 'lib/latex-flow/tools/generic.rb', line 33

def stderr_with_color
  @stderr
end

#stdout_with_colorObject



25
26
27
# File 'lib/latex-flow/tools/generic.rb', line 25

def stdout_with_color
  @stdout
end

#success?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/latex-flow/tools/generic.rb', line 17

def success?
  @process.success?
end