<commit_before>class RubyServ::Protocol
  attr_reader :socket

  def initialize(socket)
    @socket = socket
  end

  [:handle_incoming, :authenticate].each do |name|
    define_method(name) { |input| raise "##{name} must be defined in the protocol" }
  end

  # :42AAAABCJ VERSION :0RS
  # :42AAAABCJ PRIVMSG 0RSSR0001 :VERSION
  def handle_version(input)
    version = "RubyServ #{RubyServ::VERSION} (#{RubyServ.config.rubyserv.hostname} #{RubyServ::REVISION}) https://github.com/jameswritescode/rubyserv"

    if input =~ /^:(\S+) VERSION :(\S+)$/
      send_raw(":#{$2} 004 #{$1} :#{version}")
    elsif input =~ /^:(\S+) PRIVMSG (\S+) :\x01VERSION\x01$/
      RubyServ::IRC::Client.find_by_uid($2).notice($1, "\001VERSION #{version}\001")
    end
  end

  def handle_client_commands(input)
    RubyServ::PLUGINS.each do |plugin|
      plugin.__read(input) if plugin.connected?
    end
  end

  def send_raw(text)
    RubyServ::Logger.outgoing text

    sleep(0.05)
    @socket.puts "#{text}\r"
  end
end<commit_msg>update the github link for VERSION output<commit_after>class RubyServ::Protocol
  attr_reader :socket

  def initialize(socket)
    @socket = socket
  end

  [:handle_incoming, :authenticate].each do |name|
    define_method(name) { |input| raise "##{name} must be defined in the protocol" }
  end

  # :42AAAABCJ VERSION :0RS
  # :42AAAABCJ PRIVMSG 0RSSR0001 :VERSION
  def handle_version(input)
    version = "RubyServ #{RubyServ::VERSION} (#{RubyServ.config.rubyserv.hostname} #{RubyServ::REVISION}) https://github.com/rubyserv/rubyserv"

    if input =~ /^:(\S+) VERSION :(\S+)$/
      send_raw(":#{$2} 004 #{$1} :#{version}")
    elsif input =~ /^:(\S+) PRIVMSG (\S+) :\x01VERSION\x01$/
      RubyServ::IRC::Client.find_by_uid($2).notice($1, "\001VERSION #{version}\001")
    end
  end

  def handle_client_commands(input)
    RubyServ::PLUGINS.each do |plugin|
      plugin.__read(input) if plugin.connected?
    end
  end

  def send_raw(text)
    RubyServ::Logger.outgoing text

    sleep(0.05)
    @socket.puts "#{text}\r"
  end
end
{'fraction_non_alphanumeric': 0.1591460456089277, 'fraction_numerical': 0.02911208151382824, 'mean_word_length': 3.82903981264637, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '3677350', 'n_tokens_mistral': 819, 'n_tokens_neox': 746, 'n_words': 161}