Module: Rubbr::Builder
- Extended by:
- Cli
- Defined in:
- lib/rubbr/builder.rb,
lib/rubbr/builder/ps.rb,
lib/rubbr/builder/dvi.rb,
lib/rubbr/builder/tex.rb
Overview
Handles the business of building latex (and bibtex if needed) source files into binary formats as dvi, ps, and pdf. The latex and bibtex utilites need to be run a certain number of times so that things like table of contents, references, citations, etc become proper. This module tries to solve this issue by running the needed utilities only as many times as needed.
Defined Under Namespace
Class Method Summary collapse
-
.build ⇒ Object
Build to the spesified format.
- .build_in_a_loop ⇒ Object
- .do_build ⇒ Object
Methods included from Cli
color?, disable_stderr, disable_stdinn, disable_stdout, error, executable?, notice, valid_executable, warning
Class Method Details
.build ⇒ Object
Build to the spesified format.
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/rubbr/builder.rb', line 15 def self.build if Rubbr::Change.d? do_build elsif Rubbr.[:force] notice "No changes in #{Rubbr.[:build_dir]} since last build, building anyway (--force)" do_build else notice "No changes in #{Rubbr.[:build_dir]} since last build" end end |
.build_in_a_loop ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/rubbr/builder.rb', line 26 def self.build_in_a_loop delay = Rubbr.[:loop_delay] delay = 0.5 if delay == 0.0 notice "Entering build loop. Press Ctrl-C to break out." while true if Rubbr::Change.d? notice "Change detected, building" do_build end sleep delay end end |
.do_build ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/rubbr/builder.rb', line 43 def self.do_build if Rubbr.[:engine] == :pdflatex Rubbr::Builder::Tex.build else case Rubbr.[:format] when :dvi Rubbr::Builder::Tex.build when :ps Rubbr::Builder::Tex.build Rubbr::Builder::Dvi.build else Rubbr::Builder::Tex.build Rubbr::Builder::Dvi.build Rubbr::Builder::Ps.build end end end |