<commit_before>require "gds_api/publishing_api/special_route_publisher"

class SpecialRoutePublisher
  def initialize(publisher_options)
    @publishing_api = publisher_options[:publishing_api]
    @publisher = GdsApi::PublishingApi::SpecialRoutePublisher.new(publisher_options)
  end

  def publish(route_type, route)
    @publisher.publish(
      route.merge(
        publishing_app: "collections-publisher",
        rendering_app: "collections",
        type: route_type,
        public_updated_at: Time.zone.now.iso8601,
        update_type: "major",
      ),
    )
  end

  def unpublish(content_id, options)
    @publishing_api.unpublish(content_id, options)
  end

  def self.routes
    {
      prefix: [
        {
          document_type: "answer",
          content_id: "bb986a97-3b8c-4b1a-89bf-2a9f46be9747",
          base_path: "/eubusiness",
          title: "Trade with the UK from 1 January 2021 as a business based in the EU",
          description: "The UK has left the EU. On 31 December 2020 the UK will leave the EU single market and customs union. From 1 January 2021 the rules for trading with the UK will change.",
        },
      ],
    }
  end
end
<commit_msg>Change /eubusiness to an exact route<commit_after>require "gds_api/publishing_api/special_route_publisher"

class SpecialRoutePublisher
  def initialize(publisher_options)
    @publishing_api = publisher_options[:publishing_api]
    @publisher = GdsApi::PublishingApi::SpecialRoutePublisher.new(publisher_options)
  end

  def publish(route_type, route)
    @publisher.publish(
      route.merge(
        publishing_app: "collections-publisher",
        rendering_app: "collections",
        type: route_type,
        public_updated_at: Time.zone.now.iso8601,
        update_type: "major",
      ),
    )
  end

  def unpublish(content_id, options)
    @publishing_api.unpublish(content_id, options)
  end

  def self.routes
    {
      exact: [
        {
          document_type: "answer",
          content_id: "bb986a97-3b8c-4b1a-89bf-2a9f46be9747",
          base_path: "/eubusiness",
          title: "Trade with the UK from 1 January 2021 as a business based in the EU",
          description: "The UK has left the EU. On 31 December 2020 the UK will leave the EU single market and customs union. From 1 January 2021 the rules for trading with the UK will change.",
        },
      ],
    }
  end
end

{'fraction_non_alphanumeric': 0.08395989974937343, 'fraction_numerical': 0.03258145363408521, 'mean_word_length': 2.9198036006546646, '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': '4601382', 'n_tokens_mistral': 802, 'n_tokens_neox': 740, 'n_words': 195}