lib/guard/livereload/reactor.rb in guard-livereload-0.1.5 vs lib/guard/livereload/reactor.rb in guard-livereload-0.1.6
- old
+ new
@@ -18,11 +18,15 @@
end
def reload_browser(paths = [])
UI.info "Reloading browser: #{paths.join(' ')}"
paths.each do |path|
- data = ['refresh', { :path => path, :apply_js_live => @options[:apply_js_live], :apply_css_live => @options[:apply_css_live] }].to_json
+ data = ['refresh', {
+ :path => path,
+ :apply_js_live => @options[:apply_js_live],
+ :apply_css_live => @options[:apply_css_live]
+ }].to_json
UI.debug data
@web_sockets.each { |ws| ws.send(data) }
end
end
@@ -30,10 +34,10 @@
def start_threaded_reactor(options)
Thread.new do
EventMachine.run do
UI.info "LiveReload #{options[:api_version]} is waiting for a browser to connect."
- EventMachine::WebSocket.start(:host => options[:host], :port => options[:port]) do |ws|
+ EventMachine.start_server(options[:host], options[:port], EventMachine::WebSocket::Connection, {}) do |ws|
ws.onopen do
begin
UI.info "Browser connected."
ws.send "!!ver:#{options[:api_version]}"
@web_sockets << ws
\ No newline at end of file