Class: Listen::Adapter::Config

Inherits:
Object
  • Object
show all
Defined in:
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
# File '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

  @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/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/listen/adapter/config.rb', line 8

def directories
  @directories
end

#queueObject (readonly)

Returns the value of attribute queue


8
9
10
# File 'lib/listen/adapter/config.rb', line 8

def queue
  @queue
end

#silencerObject (readonly)

Returns the value of attribute silencer


8
9
10
# File 'lib/listen/adapter/config.rb', line 8

def silencer
  @silencer
end