<commit_before># encoding: utf-8

require "faye/websocket"
require "forwardable"
require "sockjs/transport"

module SockJS
  module Transports
    module WSDebuggingMixin
      def send(msg)
        if $DEBUG
          puts "~> WS#send #{msg.inspect} #{caller[0]}"
        else
          puts "~> WS#send #{msg.inspect}"
        end
        super msg
      end
    end

    class WebSocket < Transport
      extend Forwardable

      # Settings.
      self.prefix = /[^.]+\/([^.]+)\/websocket$/
      self.method = "GET"

      def session_class
        SockJS::Session
      end

      def send(_, data, *)
        @ws.send(self.format_frame(data))<commit_msg>Ah, better backtraces & more info.<commit_after># encoding: utf-8

require "faye/websocket"
require "forwardable"
require "sockjs/transport"

module SockJS
  module Transports
    module WSDebuggingMixin
      def send(msg)
        if $DEBUG
          puts "~> WS#send #{msg.inspect} #{caller[0..2].map { |item| item.sub(Dir.pwd + "/lib/", "") }.inspect}"
        else
          puts "~> WS#send #{msg.inspect}"
        end
        super msg
      end
    end

    class WebSocket < Transport
      extend Forwardable

      # Settings.
      self.prefix = /[^.]+\/([^.]+)\/websocket$/
      self.method = "GET"

      def session_class
        SockJS::Session
      end

      def send(_, data, *)
        @ws.send(self.format_frame(data))
{'fraction_non_alphanumeric': 0.1334760885082084, 'fraction_numerical': 0.0035688793718772305, 'mean_word_length': 2.0881057268722465, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6520611', 'n_tokens_mistral': 474, 'n_tokens_neox': 449, 'n_words': 107}