lib/guard/livereload/reactor.rb in guard-livereload-0.2.1 vs lib/guard/livereload/reactor.rb in guard-livereload-0.3.0

- old
+ new

@@ -1,7 +1,7 @@ require 'em-websocket' -require 'json' +require 'multi_json' module Guard class LiveReload class Reactor @@ -18,14 +18,14 @@ end def reload_browser(paths = []) UI.info "Reloading browser: #{paths.join(' ')}" paths.each do |path| - data = ['refresh', { + data = MultiJson.encode(['refresh', { :path => "#{Dir.pwd}/#{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