Sha256: f48373b08d769e66162922583a374965355882415f5b0a44ff90e8834af6603d

Contents?: true

Size: 1.31 KB

Versions: 47

Compression:

Stored size: 1.31 KB

Contents

module Listen

  autoload :Turnstile,         'listen/turnstile'
  autoload :Listener,          'listen/listener'
  autoload :MultiListener,     'listen/multi_listener'
  autoload :DirectoryRecord,   'listen/directory_record'
  autoload :DependencyManager, 'listen/dependency_manager'
  autoload :Adapter,           'listen/adapter'

  module Adapters
    autoload :Darwin,  'listen/adapters/darwin'
    autoload :Linux,   'listen/adapters/linux'
    autoload :BSD,     'listen/adapters/bsd'
    autoload :Windows, 'listen/adapters/windows'
    autoload :Polling, 'listen/adapters/polling'
  end

  # Listens to filesystem modifications on a either single directory or multiple directories.
  #
  # @param (see Listen::Listener#new)
  # @param (see Listen::MultiListener#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 = if args.length == 1 || ! args[1].is_a?(String)
      Listener.new(*args, &block)
    else
      MultiListener.new(*args, &block)
    end

    block ? listener.start : listener
  end

end

Version data entries

47 entries across 42 versions & 7 rubygems

Version Path
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/sass-3.2.19/vendor/listen/lib/listen.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/sass-3.2.19/vendor/listen/lib/listen.rb
sadui-0.0.4 vendor/bundle/ruby/2.1.0/gems/sass-3.2.14/vendor/listen/lib/listen.rb
sadui-0.0.4 vendor/bundle/ruby/2.0.0/gems/sass-3.2.14/vendor/listen/lib/listen.rb
sass-3.2.19 vendor/listen/lib/listen.rb
sass-3.2.18 vendor/listen/lib/listen.rb
sass-3.2.17 vendor/listen/lib/listen.rb
sass-3.2.16 vendor/listen/lib/listen.rb
sass-3.3.0 vendor/listen/lib/listen.rb
sass-3.2.15 vendor/listen/lib/listen.rb
sass-3.3.0.rc.3 vendor/listen/lib/listen.rb
sass-3.2.14 vendor/listen/lib/listen.rb
mango-0.8.0 vendor/bundler/ruby/2.1.0/gems/sass-3.2.13/vendor/listen/lib/listen.rb
mango-0.7.1 vendor/bundler/ruby/2.0.0/gems/sass-3.2.12/vendor/listen/lib/listen.rb
sass-3.2.13 vendor/listen/lib/listen.rb
mango-0.7.0 vendor/bundler/ruby/2.0.0/gems/sass-3.2.12/vendor/listen/lib/listen.rb
sass-3.3.0.rc.2 vendor/listen/lib/listen.rb
sass-3.2.12 vendor/listen/lib/listen.rb
sass-3.2.11 vendor/listen/lib/listen.rb
sass-3.2.10 vendor/listen/lib/listen.rb