Class: Guard::Pdflatex
- Defined in:
- lib/guard/pdflatex.rb,
lib/guard/pdflatex/version.rb
Overview
The PDFLatex Guard automatically compiles your latex files with pdflatex.
Constant Summary collapse
- OPTIONS =
{ title: 'PDFLatex' }
- VERSION =
'0.0.3'
Instance Method Summary collapse
-
#run_all ⇒ Object
Gets called when all files should be regenerated.
- #run_on_changes(paths) ⇒ Object
Instance Method Details
#run_all ⇒ Object
Gets called when all files should be regenerated.
15 16 17 |
# File 'lib/guard/pdflatex.rb', line 15 def run_all run_on_changes(Watcher.match_files(self, Dir.glob('**{,/*/**}/*.tex'))) end |
#run_on_changes(paths) ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/guard/pdflatex.rb', line 21 def run_on_changes(paths) failed = false paths.each do |path| unless system *%W[/usr/bin/env pdflatex -halt-on-error -output-directory=#{File.dirname path}], path ::Guard::Notifier.notify "PDFLatex halted on an error in #{path}", OPTIONS.merge(:image => :failed) failed = true end end throw :task_has_failed if failed end |