2009-08-30 18:37:24 +00:00
|
|
|
class FSSM::Monitor
|
|
|
|
def initialize(options={})
|
|
|
|
@options = options
|
|
|
|
@backend = FSSM::Backends::Default.new
|
|
|
|
end
|
2009-09-03 05:42:59 +00:00
|
|
|
|
2009-08-30 18:37:24 +00:00
|
|
|
def path(*args, &block)
|
|
|
|
path = FSSM::Path.new(*args)
|
2010-01-19 01:11:06 +00:00
|
|
|
FSSM::Support.use_block(path, block)
|
2009-09-03 05:42:59 +00:00
|
|
|
|
2010-01-19 01:11:06 +00:00
|
|
|
@backend.add_handler(FSSM::State::Directory.new(path))
|
|
|
|
path
|
|
|
|
end
|
|
|
|
|
|
|
|
def file(*args, &block)
|
|
|
|
path = FSSM::Path.new(*args)
|
|
|
|
FSSM::Support.use_block(path, block)
|
2009-09-03 05:42:59 +00:00
|
|
|
|
2010-01-19 01:11:06 +00:00
|
|
|
@backend.add_handler(FSSM::State::File.new(path))
|
2009-08-30 18:37:24 +00:00
|
|
|
path
|
|
|
|
end
|
2009-09-03 05:42:59 +00:00
|
|
|
|
2009-08-30 18:37:24 +00:00
|
|
|
def run
|
|
|
|
@backend.run
|
|
|
|
end
|
|
|
|
end
|