Sha256: e9b253933bc4a33e2e7e5437ef5a697b7110a6406af70a1780c541ff262daf09

Contents?: true

Size: 1.53 KB

Versions: 91

Compression:

Stored size: 1.53 KB

Contents

require 'listen/turnstile'
require 'listen/listener'
require 'listen/directory_record'
require 'listen/adapter'

module Listen

  module Adapters
    Adapter::ADAPTERS.each do |adapter|
      require "listen/adapters/#{adapter.downcase}"
    end
  end

  # Listens to file system modifications on a either single directory or multiple directories.
  # When calling this method, the current thread is not blocked.
  #
  # @param (see Listen::Listener#new)
  #
  # @yield [modified, added, removed] the changed files
  # @yieldparam [Array<String>] modified the list of modified files
  # @yieldparam [Array<String>] added the list of added files
  # @yieldparam [Array<String>] removed the list of removed files
  #
  # @return [Listen::Listener] the file listener if no block given
  #
  def self.to(*args, &block)
    listener = _init_listener(*args, &block)

    block ? listener.start : listener
  end

  # Listens to file system modifications on a either single directory or multiple directories.
  # When calling this method, the current thread is blocked.
  #
  # @param (see Listen::Listener#new)
  #
  # @yield [modified, added, removed] the changed files
  # @yieldparam [Array<String>] modified the list of modified files
  # @yieldparam [Array<String>] added the list of added files
  # @yieldparam [Array<String>] removed the list of removed files
  #
  # @since 1.0.0
  #
  def self.to!(*args, &block)
    _init_listener(*args, &block).start!
  end

  # @private
  #
  def self._init_listener(*args, &block)
    Listener.new(*args, &block)
  end

end

Version data entries

91 entries across 88 versions & 7 rubygems

Version Path
files.com-1.0.55 docs/vendor/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen.rb
brakeman-4.4.0 bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen.rb
brakeman-4.3.1 bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen.rb
brakeman-4.3.0 bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen.rb
brakeman-4.2.1 bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen.rb
brakeman-4.2.0 bundle/ruby/2.3.0/gems/sass-3.4.25/vendor/listen/lib/listen.rb
brakeman-4.1.1 bundle/ruby/2.3.0/gems/sass-3.4.25/vendor/listen/lib/listen.rb
brakeman-4.1.0 bundle/ruby/2.3.0/gems/sass-3.4.25/vendor/listen/lib/listen.rb
brakeman-4.0.1 bundle/ruby/2.3.0/gems/sass-3.4.25/vendor/listen/lib/listen.rb
brakeman-4.0.1.pre1 bundle/ruby/2.3.0/gems/sass-3.4.25/vendor/listen/lib/listen.rb
brakeman-4.0.0 bundle/ruby/2.3.0/gems/sass-3.4.25/vendor/listen/lib/listen.rb
brakeman-3.7.2 bundle/ruby/2.3.0/gems/sass-3.4.25/vendor/listen/lib/listen.rb
brakeman-3.7.1 bundle/ruby/2.3.0/gems/sass-3.4.25/vendor/listen/lib/listen.rb
sass-3.4.25 vendor/listen/lib/listen.rb
brakeman-3.7.0 bundle/ruby/2.3.0/gems/sass-3.4.24/vendor/listen/lib/listen.rb
brakeman-3.6.2 bundle/ruby/2.3.0/gems/sass-3.4.24/vendor/listen/lib/listen.rb
sass-3.4.24 vendor/listen/lib/listen.rb
brakeman-3.6.1 bundle/ruby/2.3.0/gems/sass-3.4.23/vendor/listen/lib/listen.rb
brakeman-3.6.0 bundle/ruby/2.3.0/gems/sass-3.4.23/vendor/listen/lib/listen.rb
brakeman-3.5.0 bundle/ruby/2.3.0/gems/sass-3.4.23/vendor/listen/lib/listen.rb