Class: Listen::Adapter::BSD

Inherits:
Base show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/listen-3.8.0/lib/listen/adapter/bsd.rb

Constant Summary collapse

OS_REGEXP =
/bsd|dragonfly/i.freeze
DEFAULTS =
{
  events: [
    :delete,
    :write,
    :extend,
    :attrib,
    :rename
    # :link, :revoke
  ]
}.freeze
BUNDLER_DECLARE_GEM =
<<-EOS.gsub(/^ {6}/, '')
  Please add the following to your Gemfile to avoid polling for changes:
    require 'rbconfig'
    if RbConfig::CONFIG['target_os'] =~ /#{OS_REGEXP}/
      gem 'rb-kqueue', '>= 0.2'
    end
EOS

Instance Attribute Summary

Attributes inherited from Base

#config, #options

Class Method Summary collapse

Methods inherited from Base

#configure, #initialize, #start, #started?, #stop

Constructor Details

This class inherits a constructor from Listen::Adapter::Base

Class Method Details

.usable?Boolean

Returns:

  • (Boolean)


31
32
33
34
35
36
37
38
39
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/listen-3.8.0/lib/listen/adapter/bsd.rb', line 31

def self.usable?
  return false unless super
  require 'rb-kqueue'
  require 'find'
  true
rescue LoadError
  Kernel.warn BUNDLER_DECLARE_GEM
  false
end