govuk_personalisation 0.13.0 → 0.14.0

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: 3a5a2220ec7824bf32bffa97e4965169731f346303b2712908b4160587c85b1f
4
- data.tar.gz: 9129d15308675709673f548c3df9d8be6c9d72a076395ef1817e563eb7482572
3
+ metadata.gz: 9bcf8d368f8b0a1b1262d714d53eca96638270d12d9a064bb91439d384b42eb0
4
+ data.tar.gz: 277a7a1ca1a96370676bbce2548a85a033a73b8c49e1bcae6ca3f56671e45c6f
5
5
  SHA512:
6
- metadata.gz: a1ad6932786c4569c68280bab4e0e02a74b0e0afae6e504028c94a6877273ae9c8df75c7de869fcba9eb3502067e2acf724fb72be17a00e04c5c7ac6a03d46a7
7
- data.tar.gz: bd8db5c53d6f7526bb10f3ae8ca0240500932dfa6b91d361c3ae79ede0055dbcfc0c2faf7c87bd0f5fbe51b9dfecea307c176e7b004800f4db94c7ed5b50e214
6
+ metadata.gz: 1cd009d3a20051533961e3c581b178ffde8def6bf2e29fc4b2bde9745626abed38aa8153c8a99153401dac9b2d72d1cfcdfe97cad465f01f512bd8367d018167
7
+ data.tar.gz: 5c68fbff6fdbb178bb13e07e9002ba934a78e68a40e309de241495cd6eee265ab6ca5be0a8fe0f9bda39aa465e069baac407a433d72b0174d18feb6dfa30c65c
@@ -7,7 +7,7 @@ jobs:
7
7
  fail-fast: false
8
8
  matrix:
9
9
  # Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0'
10
- ruby: [2.7, '3.0', 3.1, 3.2]
10
+ ruby: ['3.0', 3.1, 3.2]
11
11
  runs-on: ubuntu-latest
12
12
  steps:
13
13
  - uses: actions/checkout@v3
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.7.6
1
+ 3.0.5
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ # 0.14.0
2
+
3
+ - Use GOVUK_ENVIRONMENT as a backstop for DIGITAL_IDENTITY_ENVIRONMENT ([#53](https://github.com/alphagov/govuk_personalisation/pull/53))
4
+ - Drop Ruby 2.7 support ([#51](https://github.com/alphagov/govuk_personalisation/pull/51))
5
+
1
6
  # 0.13.0
2
7
 
3
8
  - Minimum Ruby version is now 2.7.6 ([#39](https://github.com/alphagov/govuk_personalisation/pull/39))
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
14
14
  spec.description = "A gem to hold shared code which other GOV.UK apps will use to implement accounts-related functionality."
15
15
  spec.homepage = "https://github.com/alphagov/govuk_personalisation"
16
16
  spec.license = "MIT"
17
- spec.required_ruby_version = Gem::Requirement.new(">= 2.7.6")
17
+ spec.required_ruby_version = Gem::Requirement.new(">= 3.0")
18
18
 
19
19
  # Specify which files should be added to the gem when it is released.
20
20
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
@@ -33,5 +33,5 @@ Gem::Specification.new do |spec|
33
33
  spec.add_development_dependency "pry-byebug"
34
34
  spec.add_development_dependency "rake"
35
35
  spec.add_development_dependency "rspec-rails"
36
- spec.add_development_dependency "rubocop-govuk", "4.9.0"
36
+ spec.add_development_dependency "rubocop-govuk", "4.11.0"
37
37
  end
@@ -3,7 +3,7 @@
3
3
  module GovukPersonalisation::Flash
4
4
  SESSION_SEPARATOR = "$$"
5
5
  MESSAGE_SEPARATOR = ","
6
- MESSAGE_REGEX = /\A[a-zA-Z0-9._-]+\z/.freeze
6
+ MESSAGE_REGEX = /\A[a-zA-Z0-9._-]+\z/
7
7
 
8
8
  # Splits the session header into a session value (suitable for using
9
9
  # in account-api calls) and flash messages.
@@ -95,11 +95,16 @@ module GovukPersonalisation::Urls
95
95
  #
96
96
  # @return [String] the domain
97
97
  def self.digital_identity_domain
98
- environment = ENV["DIGITAL_IDENTITY_ENVIRONMENT"]
99
- if environment
100
- "home.#{environment}.account.gov.uk"
98
+ if digital_identity_environment
99
+ "home.#{digital_identity_environment}.account.gov.uk"
101
100
  else
102
101
  "home.account.gov.uk"
103
102
  end
104
103
  end
104
+
105
+ def self.digital_identity_environment
106
+ return ENV["DIGITAL_IDENTITY_ENVIRONMENT"] if ENV["DIGITAL_IDENTITY_ENVIRONMENT"]
107
+
108
+ ENV["GOVUK_ENVIRONMENT"] == "production" ? nil : ENV["GOVUK_ENVIRONMENT"]
109
+ end
105
110
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GovukPersonalisation
4
- VERSION = "0.13.0"
4
+ VERSION = "0.14.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_personalisation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-01-19 00:00:00.000000000 Z
11
+ date: 2023-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: plek
@@ -120,14 +120,14 @@ dependencies:
120
120
  requirements:
121
121
  - - '='
122
122
  - !ruby/object:Gem::Version
123
- version: 4.9.0
123
+ version: 4.11.0
124
124
  type: :development
125
125
  prerelease: false
126
126
  version_requirements: !ruby/object:Gem::Requirement
127
127
  requirements:
128
128
  - - '='
129
129
  - !ruby/object:Gem::Version
130
- version: 4.9.0
130
+ version: 4.11.0
131
131
  description: A gem to hold shared code which other GOV.UK apps will use to implement
132
132
  accounts-related functionality.
133
133
  email:
@@ -170,14 +170,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
170
170
  requirements:
171
171
  - - ">="
172
172
  - !ruby/object:Gem::Version
173
- version: 2.7.6
173
+ version: '3.0'
174
174
  required_rubygems_version: !ruby/object:Gem::Requirement
175
175
  requirements:
176
176
  - - ">="
177
177
  - !ruby/object:Gem::Version
178
178
  version: '0'
179
179
  requirements: []
180
- rubygems_version: 3.4.4
180
+ rubygems_version: 3.4.15
181
181
  signing_key:
182
182
  specification_version: 4
183
183
  summary: A gem to hold shared code which other GOV.UK apps will use to implement accounts-related