Class: LTX::Build
- Inherits:
-
Object
- Object
- LTX::Build
- Defined in:
- lib/ltx/build.rb
Overview
Ruby LaTeX builder
Defined Under Namespace
Classes: Error
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(config) ⇒ Build
constructor
A new instance of Build.
- #view ⇒ Object
Constructor Details
#initialize(config) ⇒ Build
Returns a new instance of Build.
10 11 12 13 14 |
# File 'lib/ltx/build.rb', line 10 def initialize(config) @config = config @command = build_command end |
Instance Method Details
#call ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/ltx/build.rb', line 16 def call t1 = Time.now puts 'Compiling Latex Project...' puts @command.join(' ') FileUtils.mkdir_p @config.compile_dir # FileUtils.cp Dir.glob(File.join(@config.root,("*.bst"))), # @config.compile_dir Kernel.system(*@command) t = Time.now - t1 puts "Finished compiling in #{t} seconds" self end |
#view ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/ltx/build.rb', line 29 def view puts 'Starting PDF Viewer...' puts view_command.join(' ') Kernel.system(*view_command) self end |