Class: Listen::Adapter::Config

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(directories, queue, silencer, adapter_options) ⇒ Config

Returns a new instance of Config.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/listen-3.8.0/lib/listen/adapter/config.rb', line 10

def initialize(directories, queue, silencer, adapter_options)
  # Default to current directory if no directories are supplied
  directories = [Dir.pwd] if directories.to_a.empty?

  # TODO: fix (flatten, array, compact?)
  @directories = directories.map do |directory|
    Pathname.new(directory.to_s).realpath
  end

  @directories.each do |pathname|
    unless pathname.directory?
      fail ArgumentError, "must be a directory: #{pathname}"
    end
  end

  @silencer = silencer
  @queue = queue
  @adapter_options = adapter_options
end

Instance Attribute Details

#adapter_optionsObject (readonly)

Returns the value of attribute adapter_options.



8
9
10
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/listen-3.8.0/lib/listen/adapter/config.rb', line 8

def adapter_options
  @adapter_options
end

#directoriesObject (readonly)

Returns the value of attribute directories.



8
9
10
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/listen-3.8.0/lib/listen/adapter/config.rb', line 8

def directories
  @directories
end

#queueObject (readonly)

Returns the value of attribute queue.



8
9
10
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/listen-3.8.0/lib/listen/adapter/config.rb', line 8

def queue
  @queue
end

#silencerObject (readonly)

Returns the value of attribute silencer.



8
9
10
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/listen-3.8.0/lib/listen/adapter/config.rb', line 8

def silencer
  @silencer
end