<commit_before>require 'pact/matchers'
require 'pact/consumer/request'
require 'pact/mock_service/interactions/interaction_mismatch'
require 'pact/consumer_contract'
require 'pact/mock_service/response_decorator'
require 'pact/mock_service/interaction_decorator'
require 'pact/mock_service/request_handlers/base_request_handler'

module Pact
  module MockService
    module RequestHandlers

      module PrettyGenerate
        #Doesn't seem to reliably pretty generate unless we go to JSON and back again :(
        def pretty_generate object
          begin
            JSON.pretty_generate(JSON.parse(object.to_json))
          rescue JSON::ParserError
            object
          end
        end
      end

      class InteractionReplay < BaseRequestHandler
        include Pact::Matchers
        include PrettyGenerate

        attr_accessor :name, :logger, :expected_interactions, :actual_interactions, :verified_interactions, :multiple_interactions_handler

        def initialize name, logger, session, cors_enabled = false, stub = false
          @name = name<commit_msg>Update interaction_replay.rb<commit_after>require 'pact/matchers'
require 'pact/consumer/request'
require 'pact/mock_service/interactions/interaction_mismatch'
require 'pact/consumer_contract'
require 'pact/mock_service/response_decorator'
require 'pact/mock_service/interaction_decorator'
require 'pact/mock_service/request_handlers/base_request_handler'

module Pact
  module MockService
    module RequestHandlers

      module PrettyGenerate
        #Doesn't seem to reliably pretty generate unless we go to JSON and back again :(
        def pretty_generate object
          begin
            JSON.pretty_generate(JSON.parse(object.to_json))
          rescue
            object
          end
        end
      end

      class InteractionReplay < BaseRequestHandler
        include Pact::Matchers
        include PrettyGenerate

        attr_accessor :name, :logger, :expected_interactions, :actual_interactions, :verified_interactions, :multiple_interactions_handler

        def initialize name, logger, session, cors_enabled = false, stub = false
          @name = name
{'fraction_non_alphanumeric': 0.06073249884098285, 'fraction_numerical': 0.0, 'mean_word_length': 3.4403292181069958, 'pattern_counts': {'":': 0, '<': 5, '<?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': '415506', 'n_tokens_mistral': 591, 'n_tokens_neox': 570, 'n_words': 143}