<commit_before>require 'bunny'

module GovukSeedCrawler
  class Messaging
    def connect(options = {})
      conn = Bunny.new(options)
      conn.start

      @channel = conn.create_channel
    end

    def connect_to_topic
      @exchange = channel.topic(@exchange_name, :durable => true)
    end

    def publish_url(url)
      unless @exchange raise "Exchange not defined"
      unless @topic_name raise "Topic not defined"
      unless url raise "URL not defined"
<commit_msg>Raise an error if no exchange name is specified<commit_after>require 'bunny'

module GovukSeedCrawler
  class Messaging
    def connect(options = {})
      conn = Bunny.new(options)
      conn.start

      @channel = conn.create_channel
    end

    def connect_to_topic
      unless @exchange_name raise "No exchange specified"
      @exchange = channel.topic(@exchange_name, :durable => true)
    end

    def publish_url(url)
      unless @exchange raise "Exchange not defined"
      unless @topic_name raise "Topic not defined"
      unless url raise "URL not defined"

{'fraction_non_alphanumeric': 0.07495256166982922, 'fraction_numerical': 0.0, 'mean_word_length': 3.0733590733590734, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4993308', 'n_tokens_mistral': 320, 'n_tokens_neox': 302, 'n_words': 96}