From 82f13443a508600a94319ce0e636d04f0ed4673e Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 22 Jun 2015 16:19:30 +0200 Subject: Spacing --- lib/action_cable/connection/base.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/action_cable/connection/base.rb b/lib/action_cable/connection/base.rb index 7db554294a..5951198f36 100644 --- a/lib/action_cable/connection/base.rb +++ b/lib/action_cable/connection/base.rb @@ -120,16 +120,17 @@ module ActionCable log_exception(e) end - def decode_json(json) ActiveSupport::JSON.decode json end + def respond_to_invalid_request logger.info finished_request_message [ 404, { 'Content-Type' => 'text/plain' }, [ 'Page not found' ] ] end + def websocket_alive? websocket && websocket.ready_state == Faye::WebSocket::API::OPEN end @@ -138,6 +139,7 @@ module ActionCable @is_websocket ||= Faye::WebSocket.websocket?(@env) end + def started_request_message 'Started %s "%s"%s for %s at %s' % [ request.request_method, @@ -155,6 +157,7 @@ module ActionCable Time.now.to_default_s ] end + def log_exception(e) logger.error "There was an exception: #{e.class} - #{e.message}" logger.error e.backtrace.join("\n") -- cgit v1.2.3