2010-01-04 16:02:33 +00:00
|
|
|
dir = File.dirname(__FILE__)
|
|
|
|
$LOAD_PATH.unshift dir unless $LOAD_PATH.include?(dir)
|
2009-09-03 05:42:59 +00:00
|
|
|
|
2010-01-04 16:02:33 +00:00
|
|
|
module FSSM
|
|
|
|
FileNotFoundError = Class.new(StandardError)
|
|
|
|
CallbackError = Class.new(StandardError)
|
2009-12-16 16:57:16 +00:00
|
|
|
|
2010-01-04 16:02:33 +00:00
|
|
|
class << self
|
|
|
|
def dbg(msg=nil)
|
|
|
|
STDERR.puts(msg)
|
2009-09-06 05:59:30 +00:00
|
|
|
end
|
|
|
|
|
2010-01-04 16:02:33 +00:00
|
|
|
def monitor(*args, &block)
|
|
|
|
monitor = FSSM::Monitor.new
|
2010-01-19 01:11:06 +00:00
|
|
|
FSSM::Support.use_block(args.empty? ? monitor : monitor.path(*args), block)
|
2009-09-03 05:42:59 +00:00
|
|
|
|
2010-01-04 16:02:33 +00:00
|
|
|
monitor.run
|
2010-01-02 19:11:45 +00:00
|
|
|
end
|
|
|
|
end
|
2010-01-04 16:02:33 +00:00
|
|
|
end
|
2009-09-03 05:42:59 +00:00
|
|
|
|
2010-01-04 16:02:33 +00:00
|
|
|
require 'thread'
|
2010-01-02 19:11:45 +00:00
|
|
|
|
2010-01-04 16:02:33 +00:00
|
|
|
require 'fssm/pathname'
|
|
|
|
require 'fssm/support'
|
|
|
|
require 'fssm/tree'
|
|
|
|
require 'fssm/path'
|
2010-01-19 01:11:06 +00:00
|
|
|
require 'fssm/state/directory'
|
|
|
|
require 'fssm/state/file'
|
2010-01-04 16:02:33 +00:00
|
|
|
require 'fssm/monitor'
|
2010-01-02 19:11:45 +00:00
|
|
|
|
2010-01-04 16:02:33 +00:00
|
|
|
require "fssm/backends/#{FSSM::Support.backend.downcase}"
|
|
|
|
FSSM::Backends::Default = FSSM::Backends.const_get(FSSM::Support.backend)
|