Class: Puppet::Util::Watcher::PeriodicWatcher
- Defined in:
- lib/puppet/util/watcher/periodic_watcher.rb
Overview
Monitor a given watcher for changes on a periodic interval.
Instance Method Summary collapse
-
#changed? ⇒ true, false
If the file has changed since it was last checked.
-
#initialize(watcher, timer) ⇒ PeriodicWatcher
constructor
A new instance of PeriodicWatcher.
Constructor Details
#initialize(watcher, timer) ⇒ PeriodicWatcher
Returns a new instance of PeriodicWatcher.
7 8 9 10 11 12 |
# File 'lib/puppet/util/watcher/periodic_watcher.rb', line 7 def initialize(watcher, timer) @watcher = watcher @timer = timer @timer.start end |
Instance Method Details
#changed? ⇒ true, false
Returns If the file has changed since it was last checked.
15 16 17 18 19 20 |
# File 'lib/puppet/util/watcher/periodic_watcher.rb', line 15 def changed? return true if always_consider_changed? @watcher = examine_watched_info(@watcher) @watcher.changed? end |