compass/lib/vendor/fssm.rb

41 lines
858 B
Ruby
Raw Normal View History

2009-09-03 05:42:59 +00:00
dir = File.dirname(__FILE__)
$LOAD_PATH.unshift dir unless $LOAD_PATH.include?(dir)
module FSSM
FileNotFoundError = Class.new(StandardError)
CallbackError = Class.new(StandardError)
class << self
def dbg(msg=nil)
STDERR.puts(msg)
end
def monitor(*args, &block)
monitor = FSSM::Monitor.new
context = args.empty? ? monitor : monitor.path(*args)
2009-09-03 05:42:59 +00:00
if block_given?
if block.arity == 1
block.call(context)
else
context.instance_eval(&block)
end
end
2009-09-03 05:42:59 +00:00
monitor.run
end
end
end
2009-09-03 05:42:59 +00:00
require 'thread'
require 'fssm/pathname'
require 'fssm/support'
require 'fssm/tree'
require 'fssm/path'
require 'fssm/state'
require 'fssm/monitor'
require "fssm/backends/#{FSSM::Support.backend.downcase}"
FSSM::Backends::Default = FSSM::Backends.const_get(FSSM::Support.backend)