govuk-components 3.1.3 → 3.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5d96973745655e46c089832c7bf7045995f5026ad65acacebba3b2eaaec72ba8
4
- data.tar.gz: bdf4bd50011bf68cba44cd4df794ed59988154bd204461f0630433f55a23a55a
3
+ metadata.gz: d3840e40ffafa0fc239e251a1fd9f76c2bf6b290d0ea2f6df6a0dfd7300dd5f7
4
+ data.tar.gz: e0bbfa5d779cf3a40edce2b7282beb355738643098f50bb6a24dcb5c182a3548
5
5
  SHA512:
6
- metadata.gz: 977b348a414cf49fb9e7fd59022ff60698175a50da1489e44b0c84db0d5bf1dff5b8e6035bade8e1a3d3cc7089c98c52fcae4bda995c1a912460efa9f6c3f6dd
7
- data.tar.gz: 05fb69a77e3441634eb377d15a7a271ce945e0f27701f1fb8d1073acf8af678ab9fcacc479e328cf2ad171b2b2fcea06294048a218e03d47281de543d164d2be
6
+ metadata.gz: bdf53c97e701ab06061022e6058e70a5bc8566cd5b6fb563c51c53c364d2d70281f2aea9883bafc8f7c510be4e3fbe478580cd3dd6496e00f774c7b9f5e4b044
7
+ data.tar.gz: 7b85bbcdd1f5f05fe12a1bacdd6a56e488428174976f1b92db1eb9cfb17e9487f3c569e14532c91e6f5611e94afff18251984200c8406345dd463f296f1421e9
@@ -28,7 +28,7 @@ private
28
28
  when Hash
29
29
  breadcrumbs.map { |text, link| build_list_item(text, link) }
30
30
  else
31
- fail(ArgumentError, "breadcrumb must be an array or hash")
31
+ fail(ArgumentError, "breadcrumbs must be an array or hash")
32
32
  end
33
33
  end
34
34
 
@@ -65,9 +65,14 @@ private
65
65
  def build_meta_links(links)
66
66
  return [] if links.blank?
67
67
 
68
- fail(ArgumentError, 'meta links must be a hash') unless links.is_a?(Hash)
69
-
70
- links.map { |text, href| raw(link_to(text, href, class: %w(govuk-footer__link))) }
68
+ case links
69
+ when Array
70
+ links.map { |link| raw(link_to(link[:text], link[:href], class: %w(govuk-footer__link), **link.fetch(:attr, {}))) }
71
+ when Hash
72
+ links.map { |text, href| raw(link_to(text, href, class: %w(govuk-footer__link))) }
73
+ else
74
+ fail(ArgumentError, 'meta links must be a hash or array of hashes') unless links.is_a?(Hash)
75
+ end
71
76
  end
72
77
 
73
78
  def default_licence
@@ -105,6 +105,7 @@ private
105
105
 
106
106
  def active?
107
107
  return @active_override unless @active_override.nil?
108
+ return false if href.blank?
108
109
 
109
110
  current_page?(href)
110
111
  end
@@ -1,5 +1,5 @@
1
1
  module Govuk
2
2
  module Components
3
- VERSION = '3.1.3'.freeze
3
+ VERSION = '3.1.4'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk-components
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.3
4
+ version: 3.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - DfE developers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-05 00:00:00.000000000 Z
11
+ date: 2022-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack