Parent

Files

Guard::LiveReload::Reactor

Attributes

connections_count[R]
options[R]
thread[R]
web_sockets[R]

Public Class Methods

new(options) click to toggle source
# File lib/guard/livereload/reactor.rb, line 8
def initialize(options)
  @web_sockets       = []
  @options           = options
  @thread            = Thread.new { _start_reactor }
  @connections_count = 0
end

Public Instance Methods

reload_browser(paths = []) click to toggle source
# File lib/guard/livereload/reactor.rb, line 19
def reload_browser(paths = [])
  msg = "Reloading browser: #{paths.join(' ')}"
  UI.info msg
  if options[:notify]
    Notifier.notify(msg, title: 'Reloading browser', image: :success)
  end

  paths.each do |path|
    data = _data(path)
    UI.debug(data)
    web_sockets.each { |ws| ws.send(MultiJson.encode(data)) }
  end
end
stop() click to toggle source
# File lib/guard/livereload/reactor.rb, line 15
def stop
  thread.kill
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.