Class: SassListen::Backend

Inherits:
Object
  • Object
show all
Defined in:
lib/sass-listen/backend.rb

Instance Method Summary collapse

Constructor Details

#initialize(directories, queue, silencer, config) ⇒ Backend

Returns a new instance of Backend.


11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/sass-listen/backend.rb', line 11

def initialize(directories, queue, silencer, config)
  adapter_select_opts = config.adapter_select_options

  adapter_class = Adapter.select(adapter_select_opts)

  # Use default from adapter if possible
  @min_delay_between_events = config.min_delay_between_events
  @min_delay_between_events ||= adapter_class::DEFAULTS[:wait_for_delay]
  @min_delay_between_events ||= 0.1

  adapter_opts = config.adapter_instance_options(adapter_class)

  aconfig = Adapter::Config.new(directories, queue, silencer, adapter_opts)
  @adapter = adapter_class.new(aconfig)
end

Instance Method Details

#min_delay_between_eventsObject


35
36
37
# File 'lib/sass-listen/backend.rb', line 35

def min_delay_between_events
  @min_delay_between_events
end

#startObject


27
28
29
# File 'lib/sass-listen/backend.rb', line 27

def start
  adapter.start
end

#stopObject


31
32
33
# File 'lib/sass-listen/backend.rb', line 31

def stop
  adapter.stop
end