compass/lib/vendor/fssm/fssm/monitor.rb

27 lines
506 B
Ruby
Raw Normal View History

class FSSM::Monitor
def initialize(options={})
@options = options
@backend = FSSM::Backends::Default.new
end
2009-09-03 05:42:59 +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))
path
end
2009-09-03 05:42:59 +00:00
def run
@backend.run
end
end