Sha256: 995d3f35fbc7943cfaf580583a181581acae0f03f1ca26b83160894900e9cfbc

Contents?: true

Size: 757 Bytes

Versions: 262

Compression:

Stored size: 757 Bytes

Contents

require File.join(File.dirname(__FILE__), 'rubycocoa/fsevents')

module FSSM::Backends
  class FSEvents
    def initialize
      @handlers = {}
      @fsevents = []
    end

    def add_handler(handler, preload=true)
      @handlers[handler.path.to_s] = handler

      fsevent                      = Rucola::FSEvents.new(handler.path.to_s, {:latency => 0.5}) do |events|
        events.each do |event|
          handler.refresh(event.path)
        end
      end

      fsevent.create_stream
      handler.refresh(nil, true) if preload
      fsevent.start
      @fsevents << fsevent
    end

    def run
      begin
        OSX.CFRunLoopRun
      rescue Interrupt
        @fsevents.each do |fsev|
          fsev.stop
        end
      end
    end

  end
end

Version data entries

262 entries across 116 versions & 7 rubygems

Version Path
classiccms-0.7.5 vendor/bundle/gems/sass-3.1.15/vendor/fssm/lib/fssm/backends/fsevents.rb
classiccms-0.7.5 vendor/bundle/gems/haml-3.1.5/vendor/sass/vendor/fssm/lib/fssm/backends/fsevents.rb
classiccms-0.7.5 vendor/bundle/gems/haml-3.1.6/vendor/sass/vendor/fssm/lib/fssm/backends/fsevents.rb
classiccms-0.7.5 vendor/bundle/gems/haml-3.1.4/vendor/sass/vendor/fssm/lib/fssm/backends/fsevents.rb
classiccms-0.7.4 vendor/bundle/gems/haml-3.1.5/vendor/sass/vendor/fssm/lib/fssm/backends/fsevents.rb
classiccms-0.7.4 vendor/bundle/gems/haml-3.1.4/vendor/sass/vendor/fssm/lib/fssm/backends/fsevents.rb
classiccms-0.7.4 vendor/bundle/gems/haml-3.1.6/vendor/sass/vendor/fssm/lib/fssm/backends/fsevents.rb
classiccms-0.7.4 vendor/bundle/gems/sass-3.1.15/vendor/fssm/lib/fssm/backends/fsevents.rb
classiccms-0.7.3 vendor/bundle/gems/haml-3.1.5/vendor/sass/vendor/fssm/lib/fssm/backends/fsevents.rb
classiccms-0.7.3 vendor/bundle/gems/haml-3.1.4/vendor/sass/vendor/fssm/lib/fssm/backends/fsevents.rb
classiccms-0.7.3 vendor/bundle/gems/sass-3.1.15/vendor/fssm/lib/fssm/backends/fsevents.rb
classiccms-0.7.3 vendor/bundle/gems/haml-3.1.6/vendor/sass/vendor/fssm/lib/fssm/backends/fsevents.rb
torquebox-console-0.3.0 vendor/bundle/jruby/1.9/gems/haml-3.1.8/vendor/sass/vendor/fssm/lib/fssm/backends/fsevents.rb
classiccms-0.7.2 vendor/bundle/gems/haml-3.1.5/vendor/sass/vendor/fssm/lib/fssm/backends/fsevents.rb
classiccms-0.7.2 vendor/bundle/gems/sass-3.1.15/vendor/fssm/lib/fssm/backends/fsevents.rb
classiccms-0.7.2 vendor/bundle/gems/haml-3.1.4/vendor/sass/vendor/fssm/lib/fssm/backends/fsevents.rb
classiccms-0.7.2 vendor/bundle/gems/haml-3.1.6/vendor/sass/vendor/fssm/lib/fssm/backends/fsevents.rb
classiccms-0.7.1 vendor/bundle/gems/haml-3.1.4/vendor/sass/vendor/fssm/lib/fssm/backends/fsevents.rb
classiccms-0.7.1 vendor/bundle/gems/haml-3.1.5/vendor/sass/vendor/fssm/lib/fssm/backends/fsevents.rb
classiccms-0.7.1 vendor/bundle/gems/sass-3.1.15/vendor/fssm/lib/fssm/backends/fsevents.rb