Class: RailsHotreload::Checker

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(paths) ⇒ Checker

Returns a new instance of Checker.



13
14
15
# File 'lib/rails_hotreload.rb', line 13

def initialize(paths)
  @paths = paths
end

Instance Attribute Details

#pathsObject (readonly)

Returns the value of attribute paths.



11
12
13
# File 'lib/rails_hotreload.rb', line 11

def paths
  @paths
end

Instance Method Details

#callObject



17
18
19
20
21
22
# File 'lib/rails_hotreload.rb', line 17

def call
  puts "Listening for changes in #{paths}"
  listener = Listen.to(*paths, {}) { stream_reload }
  listener.start
  sleep
end