compass/lib/vendor/fssm.rb
Chris Eppstein b13fd43a2e Require relative to the load path instead of using the more convoluted approach of File.join(File.dirname(__FILE__), ...).
Also, don't ever muck with the load paths or rubygems without first
trying to require the library without doing so.
2009-09-02 21:45:08 -07:00

29 lines
691 B
Ruby

module FSSM
FileNotFoundError = Class.new(StandardError)
CallbackError = Class.new(StandardError)
class << self
def monitor(*args, &block)
monitor = FSSM::Monitor.new
context = args.empty? ? monitor : monitor.path(*args)
if block && block.arity == 0
context.instance_eval(&block)
elsif block && block.arity == 1
block.call(context)
end
monitor.run
end
end
end
require 'pathname'
require 'fssm/ext'
require 'fssm/support'
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)