From 0a894e5b0190339f3622b35aac93f0ee6f4cc74b Mon Sep 17 00:00:00 2001 From: Romaric Date: Mon, 21 Nov 2022 16:02:58 +0000 Subject: [PATCH] Remove UniqueIdentifierExtension for Middleman It is no longer needed for resetting the generator on the before lifecycle hook as it gets reset by the Markdown renderer --- lib/govuk_tech_docs.rb | 2 -- lib/govuk_tech_docs/unique_identifier_extension.rb | 13 ------------- 2 files changed, 15 deletions(-) delete mode 100644 lib/govuk_tech_docs/unique_identifier_extension.rb diff --git a/lib/govuk_tech_docs.rb b/lib/govuk_tech_docs.rb index 4cacd978..37843991 100644 --- a/lib/govuk_tech_docs.rb +++ b/lib/govuk_tech_docs.rb @@ -18,7 +18,6 @@ require "govuk_tech_docs/page_review" require "govuk_tech_docs/pages" require "govuk_tech_docs/tech_docs_html_renderer" -require "govuk_tech_docs/unique_identifier_extension" require "govuk_tech_docs/unique_identifier_generator" require "govuk_tech_docs/warning_text_extension" require "govuk_tech_docs/api_reference/api_reference_extension" @@ -62,7 +61,6 @@ def self.configure(context, options = {}) config_file = ENV.fetch("CONFIG_FILE", "config/tech-docs.yml") context.config[:tech_docs] = YAML.load_file(config_file).with_indifferent_access - context.activate :unique_identifier context.activate :warning_text context.activate :api_reference diff --git a/lib/govuk_tech_docs/unique_identifier_extension.rb b/lib/govuk_tech_docs/unique_identifier_extension.rb deleted file mode 100644 index bb50e943..00000000 --- a/lib/govuk_tech_docs/unique_identifier_extension.rb +++ /dev/null @@ -1,13 +0,0 @@ -module GovukTechDocs - class UniqueIdentifierExtension < Middleman::Extension - def initialize(app, options_hash = {}, &block) - super - - app.before do - UniqueIdentifierGenerator.instance.reset - end - end - end -end - -::Middleman::Extensions.register(:unique_identifier, GovukTechDocs::UniqueIdentifierExtension)