content_block_tools 0.4.1 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 18b58df1f935b54e55beaaa53766a00ba74ba07b9233459a00b82e155d13d25b
4
- data.tar.gz: 49971e740aae00d280477c88329a73653e38ea223e412c18749fe1f493b6213f
3
+ metadata.gz: f5b9b36acc6265a8bd30974d57e67a9b33dfb1240e9a9e05d6cbaf2101d2bd22
4
+ data.tar.gz: 4994f81c1f3339500cdcf21d84bdf9bf44f7ca19a5c0e2019b5c91e312f732b4
5
5
  SHA512:
6
- metadata.gz: a67d4af7d37f6c95571691356da0e3e8c463e5e01c3ea3c35b9626542eedddc5bb0bd3baa304f713095ac188380e653e567adce4473baec09d3340cacbf56197
7
- data.tar.gz: 43ccfa780acdf748532762a00523febd21c02cecf48bef34ae1add7af8d368774f7f5c2a83aa02f98a9365a62d341953758310d65f79aee466f963813ceadcae
6
+ metadata.gz: 268643e7647a673cbacfe74903cf592a148719a73ee1ca653078f108b904fafc7ed4cf6c6a1d2a194cfcafd8772d450bc175c1017dc638764167cc7ff39989e8
7
+ data.tar.gz: ee8dead83c275f5f4125165c876bb4fbfd44e23e6f1eff584a372f6eb78b98558f88910b06d3f5e74e6fe2ccf22e9f46300584a98dd19d51ff5c385d4d7e0625
data/CHANGELOG.md CHANGED
@@ -7,6 +7,14 @@
7
7
  useful summary for people upgrading their application, not a replication
8
8
  of the commit log.
9
9
 
10
+ ## 0.4.3
11
+
12
+ * Add presenter for a pension block ([20](https://github.com/alphagov/govuk_content_block_tools/pull/20))
13
+
14
+ ## 0.4.2
15
+
16
+ * Pass embed code to HTML span ([19](https://github.com/alphagov/govuk_content_block_tools/pull/19))
17
+
10
18
  ## 0.4.1
11
19
 
12
20
  * Fix field regular expression ([18](https://github.com/alphagov/govuk_content_block_tools/pull/18))
@@ -45,6 +45,7 @@ module ContentBlockTools
45
45
  CONTENT_PRESENTERS = {
46
46
  "content_block_email_address" => ContentBlockTools::Presenters::EmailAddressPresenter,
47
47
  "content_block_postal_address" => ContentBlockTools::Presenters::PostalAddressPresenter,
48
+ "content_block_pension" => ContentBlockTools::Presenters::PensionPresenter,
48
49
  }.freeze
49
50
 
50
51
  # Calls the appropriate presenter class to return a HTML representation of a content
@@ -26,7 +26,7 @@ module ContentBlockTools
26
26
  # @return [String]
27
27
  class ContentBlockReference < Data
28
28
  # An array of the supported document types
29
- SUPPORTED_DOCUMENT_TYPES = %w[contact content_block_email_address content_block_postal_address].freeze
29
+ SUPPORTED_DOCUMENT_TYPES = %w[contact content_block_email_address content_block_postal_address content_block_pension].freeze
30
30
  # The regex used to find UUIDs
31
31
  UUID_REGEX = /([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/
32
32
  # The regex to find optional field names after the UUID, begins with '/'
@@ -29,7 +29,7 @@ module ContentBlockTools
29
29
  content_block: "",
30
30
  document_type: content_block.document_type,
31
31
  content_id: content_block.content_id,
32
- field_names: field_names&.join(","),
32
+ embed_code: content_block.embed_code,
33
33
  },
34
34
  )
35
35
  end
@@ -0,0 +1,11 @@
1
+ module ContentBlockTools
2
+ module Presenters
3
+ class PensionPresenter < BasePresenter
4
+ private
5
+
6
+ def default_content
7
+ content_block.title
8
+ end
9
+ end
10
+ end
11
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ContentBlockTools
4
- VERSION = "0.4.1"
4
+ VERSION = "0.4.3"
5
5
  end
@@ -6,6 +6,7 @@ require "uri"
6
6
  require "content_block_tools/presenters/base_presenter"
7
7
  require "content_block_tools/presenters/email_address_presenter"
8
8
  require "content_block_tools/presenters/postal_address_presenter"
9
+ require "content_block_tools/presenters/pension_presenter"
9
10
 
10
11
  require "content_block_tools/content_block"
11
12
  require "content_block_tools/content_block_reference"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: content_block_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-02-06 00:00:00.000000000 Z
10
+ date: 2025-02-13 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: rake
@@ -92,6 +92,7 @@ files:
92
92
  - lib/content_block_tools/content_block_reference.rb
93
93
  - lib/content_block_tools/presenters/base_presenter.rb
94
94
  - lib/content_block_tools/presenters/email_address_presenter.rb
95
+ - lib/content_block_tools/presenters/pension_presenter.rb
95
96
  - lib/content_block_tools/presenters/postal_address_presenter.rb
96
97
  - lib/content_block_tools/version.rb
97
98
  homepage: https://github.com/alphagov/content_block_tools