Class: Listen::Adapters::Linux

Inherits:
Listen::Adapter show all
Defined in:
lib/listen/adapters/linux.rb

Overview

Listener implementation for Linux ‘inotify`.

Constant Summary collapse

EVENTS =

Watched inotify events

[:recursive, :attrib, :create, :delete, :move, :close_write]
INOTIFY_LIMIT_MESSAGE =

The message to show when the limit of inotify watchers is not enough

<<-EOS.gsub(/^\s*/, '')
  Listen error: unable to monitor directories for changes.

  Please head to https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers
  for information on how to solve this issue.
EOS

Constants inherited from Listen::Adapter

Listen::Adapter::ADAPTERS, Listen::Adapter::DEFAULT_LATENCY, Listen::Adapter::FALLBACK_ADAPTERS, Listen::Adapter::OPTIMIZED_ADAPTERS, Listen::Adapter::POLLING_FALLBACK_MESSAGE

Instance Attribute Summary

Attributes inherited from Listen::Adapter

#callback, #changed_directories, #directories, #latency, #mutex, #paused, #poller_thread, #stopped, #turnstile, #worker, #worker_thread

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Listen::Adapter

load_dependent_adapter, #pause, #paused?, #report_changes, select_and_initialize, #start, #start!, #started?, #stop, #unpause, usable?, usable_and_works?, #wait_for_callback, #wait_for_changes, works?

Constructor Details

#initialize(directories, options = {}, &callback) ⇒ Linux

Initializes the Adapter.



30
31
32
33
34
# File 'lib/listen/adapters/linux.rb', line 30

def initialize(directories, options = {}, &callback)
  super
rescue Errno::ENOSPC
  abort(INOTIFY_LIMIT_MESSAGE)
end

Class Method Details

.adapter_gemObject



24
# File 'lib/listen/adapters/linux.rb', line 24

def self.adapter_gem; 'rb-inotify'; end

.target_os_regexObject



23
# File 'lib/listen/adapters/linux.rb', line 23

def self.target_os_regex; /linux/i; end