Class: FSSM::Monitor
- Inherits:
-
Object
- Object
- FSSM::Monitor
- Defined in:
- lib/fssm/monitor.rb
Instance Method Summary collapse
- #file(path = nil, glob = nil, &block) ⇒ Object
-
#initialize(options = {}) ⇒ Monitor
constructor
A new instance of Monitor.
- #path(path = nil, glob = nil, &block) ⇒ Object
- #run ⇒ Object
Constructor Details
Instance Method Details
#file(path = nil, glob = nil, &block) ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/fssm/monitor.rb', line 16 def file(path=nil, glob=nil, &block) path = create_path(path, glob, &block) @backend.add_handler(FSSM::State::File.new(path)) path rescue FSSM::FileNotRealError => e FSSM.dbg("#{e}") nil end |
#path(path = nil, glob = nil, &block) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/fssm/monitor.rb', line 7 def path(path=nil, glob=nil, &block) path = create_path(path, glob, &block) @backend.add_handler(FSSM::State::Directory.new(path, @options)) path rescue FSSM::FileNotRealError => e FSSM.dbg("#{e}") nil end |
#run ⇒ Object
25 26 27 |
# File 'lib/fssm/monitor.rb', line 25 def run @backend.run end |