<commit_before>module Pushy
  class Handler

    attr_reader :received
    attr_accessor :monitor

    def initialize(monitor)
      @monitor = monitor
    end

    def on_readable(socket, parts)
      require 'pp'

      puts parts[0].copy_out_string

      #puts parts.each do |part|
        #pp part
        ##part.each do |p|
          ##puts p.inspect
        ##end
      #end
      monitor.checkin!
      #if valid?(parts[0].copy_out_string)
        #monitor.checkin!
        #parse_json parts[1].copy_out_string
      #end
    end

    private

    def valid?(auth)
      true
    end

    def parse_json(json)
      parser = Yajl::Parser.new
      hash = parser.parse(json)

      puts hash['type']
      puts hash['host']
    end

  end
end
<commit_msg>moved monitor line<commit_after>module Pushy
  class Handler

    attr_reader :received
    attr_accessor :monitor

    def initialize(monitor)
      @monitor = monitor
    end

    def on_readable(socket, parts)
      require 'pp'

      puts parts[0].copy_out_string
      monitor.checkin!

      #puts parts.each do |part|
        #pp part
        ##part.each do |p|
          ##puts p.inspect
        ##end
      #end
      #if valid?(parts[0].copy_out_string)
        #monitor.checkin!
        #parse_json parts[1].copy_out_string
      #end
    end

    private

    def valid?(auth)
      true
    end

    def parse_json(json)
      parser = Yajl::Parser.new
      hash = parser.parse(json)

      puts hash['type']
      puts hash['host']
    end

  end
end

{'fraction_non_alphanumeric': 0.09287115761935906, 'fraction_numerical': 0.003924133420536298, 'mean_word_length': 1.9479768786127167, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6325034', 'n_tokens_mistral': 514, 'n_tokens_neox': 497, 'n_words': 120}