Class: Spinny::ListenClient

Inherits:
Object
  • Object
show all
Defined in:
lib/spinny/listen_client.rb

Instance Method Summary collapse

Constructor Details

#initialize(dirs) ⇒ ListenClient

Returns a new instance of ListenClient.



6
7
8
9
10
11
# File 'lib/spinny/listen_client.rb', line 6

def initialize(dirs)
  @listener = Listen.to(*dirs, only: /\.rb$/) do |modified, added, removed|
    changed = modified + added
    Spinny::LoadClient.new(changed).start!
  end
end

Instance Method Details

#start!Object



13
14
15
16
# File 'lib/spinny/listen_client.rb', line 13

def start!
  @listener.start
  sleep
end