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.
9 10 11 12 13 14 |
# File 'lib/puppet/util/watcher/periodic_watcher.rb', line 9 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.
17 18 19 20 21 22 |
# File 'lib/puppet/util/watcher/periodic_watcher.rb', line 17 def changed? return true if always_consider_changed? @watcher = examine_watched_info(@watcher) @watcher.changed? end |