Class: Guard::ErbLatex
- Inherits:
-
Plugin
- Object
- Plugin
- Guard::ErbLatex
- Defined in:
- lib/erb_latex/guard.rb
Overview
The ErbLatex guard that gets notifications about the following Guard events: ‘start`, `run_all` and `run_on_modifications`.
Constant Summary collapse
- DEFAULT_OPTIONS =
{ :layout => false, :data => {}, :all_on_start => true, :hide_success => false }
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ ErbLatex
constructor
Initialize Guard::ErbLates.
-
#run_all ⇒ Object
Gets called when all files should be regenerated.
-
#run_on_modifications(paths) ⇒ Object
Gets called when watched paths and files have changes.
-
#start ⇒ Object
Gets called once when Guard starts.
Constructor Details
#initialize(options = {}) ⇒ ErbLatex
Initialize Guard::ErbLates
27 28 29 |
# File 'lib/erb_latex/guard.rb', line 27 def initialize( = {} ) super( DEFAULT_OPTIONS.merge() ) end |
Instance Method Details
#run_all ⇒ Object
Gets called when all files should be regenerated.
43 44 45 |
# File 'lib/erb_latex/guard.rb', line 43 def run_all run_on_modifications( Watcher.match_files(self, Dir.glob('**{,/*/**}/*.{tex,erb.tex,tex.erb}')) ) end |
#run_on_modifications(paths) ⇒ Object
Gets called when watched paths and files have changes.
52 53 54 |
# File 'lib/erb_latex/guard.rb', line 52 def run_on_modifications(paths) throw :task_has_failed unless ::ErbLatex::GuardRunner.run( paths, watchers, ) end |
#start ⇒ Object
Gets called once when Guard starts.
35 36 37 |
# File 'lib/erb_latex/guard.rb', line 35 def start run_all if [:all_on_start] end |