Class: Guard::DocbookStatus
- Defined in:
- lib/guard/docbook-status.rb,
lib/guard/docbook-status/version.rb
Constant Summary collapse
- VERSION =
'0.1.0'
Instance Method Summary collapse
-
#initialize(watchers = [], options = {}) ⇒ DocbookStatus
constructor
A new instance of DocbookStatus.
- #run_all ⇒ Object
- #run_on_changes(paths) ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize(watchers = [], options = {}) ⇒ DocbookStatus
Returns a new instance of DocbookStatus.
9 10 11 12 13 14 |
# File 'lib/guard/docbook-status.rb', line 9 def initialize(watchers=[], ={}) super @options = { :trigger_on_start => true }.update() end |
Instance Method Details
#run_all ⇒ Object
21 22 23 |
# File 'lib/guard/docbook-status.rb', line 21 def run_all run_on_changes([]) end |
#run_on_changes(paths) ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/guard/docbook-status.rb', line 25 def run_on_changes(paths) ::Guard::UI.info("Guard::DocbookStatus detected a change",{}) output = system("docbook_status #{@options[:cli]}") command_failure = ($?.to_i != 0) if command_failure ::Guard::UI.error("docbook_status indicated an error",{}) end end |
#start ⇒ Object
16 17 18 19 |
# File 'lib/guard/docbook-status.rb', line 16 def start ::Guard::UI.info("Guard::DocbookStatus has started watching your files",{}) run_all if @options[:trigger_on_start] end |