govuk_app_config 9.11.2 → 9.12.0

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: 2f502d5ff732d2ef2693fca10c8c4366180ca91a1e243aabc2e9c3a8c6081b7f
4
- data.tar.gz: cab52af8090596b98a8ba84f90105a161c8f64d293c437030de7c1a964832ad9
3
+ metadata.gz: 20f6c0f84338e2323ad36493234894a5b960374c173111f134062d2911d5f224
4
+ data.tar.gz: 1a83af7fc6f2ea3710bdfc34e8c0bec33c3c0799b9d00448943f433bfb6a70e2
5
5
  SHA512:
6
- metadata.gz: a88e6b1158e9ece8c93469d5c8b1b6a8af894bc79096353ca6540c632d9459d3ea46718b8e1181a4ac75a1d5580ba54d786317fb17e71bdc282babda20ee78c2
7
- data.tar.gz: bb215c586b2c3bde4119df0cca8845cdb6b06d6eeb266a9fcfd70f3fd263944f2aeaf718f3fbe8a50d93915e90b8e67b8818a6301da008bfbaa38dd5b8561d7f
6
+ metadata.gz: 81e16fe6cde2884271be25e436753544e12f75415643b4972390ab55563f72ff9e144de4e7b0692c9eced7ce8591be121c40c06d175ef014128a0d92ec0583c4
7
+ data.tar.gz: f6d1b1bdc33591394cdb16f156e51e713312b02dcd108066c71a9f05c5c27a89d2bf7b36836ce349f899058c0c0891313e1ac6a511f8878aa8b58bb4d081fabd
@@ -1,3 +1,5 @@
1
+ name: CI
2
+
1
3
  on:
2
4
  push:
3
5
  branches:
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 9.12.0
2
+
3
+ * Set time_zone to London in all GOV.UK apps ([#381](https://github.com/alphagov/govuk_app_config/pull/381))
4
+
1
5
  # 9.11.2
2
6
 
3
7
  * Fix Logstasher monkey patch overriding patch from this library for OpenTelemetry errors ([#377](https://github.com/alphagov/govuk_app_config/pull/377))
data/README.md CHANGED
@@ -8,6 +8,7 @@ Adds the basics of a GOV.UK application:
8
8
  - Statsd client for reporting stats (deprecated; use Prometheus instead)
9
9
  - Rails logging
10
10
  - Content Security Policy generation for frontend apps
11
+ - Sets the time zone to London
11
12
 
12
13
  ## Installation
13
14
 
@@ -181,6 +182,9 @@ GovukContentSecurityPolicy.configure
181
182
 
182
183
  Some frontend apps support languages that are not defined in the i18n gem. This provides them with our own custom rules for these languages.
183
184
 
185
+ ## Time zone
186
+
187
+ This gem sets `config.time_zone` to `"London"` - this cannot currently be overridden in application config.
184
188
 
185
189
  ## License
186
190
 
@@ -21,8 +21,8 @@ Gem::Specification.new do |spec|
21
21
  spec.require_paths = %w[lib]
22
22
 
23
23
  spec.add_dependency "logstasher", "~> 2.1"
24
- spec.add_dependency "opentelemetry-exporter-otlp", ">= 0.25", "< 0.27"
25
- spec.add_dependency "opentelemetry-instrumentation-all", ">= 0.39.1", "< 0.61.0"
24
+ spec.add_dependency "opentelemetry-exporter-otlp", ">= 0.25", "< 0.29"
25
+ spec.add_dependency "opentelemetry-instrumentation-all", ">= 0.39.1", "< 0.62.0"
26
26
  spec.add_dependency "opentelemetry-sdk", "~> 1.2"
27
27
  spec.add_dependency "plek", ">= 4", "< 6"
28
28
  spec.add_dependency "prometheus_exporter", "~> 2.0"
@@ -0,0 +1,14 @@
1
+ module GovukTimezone
2
+ def self.configure(config)
3
+ case config.time_zone
4
+ when "UTC"
5
+ Rails.logger.info "govuk_app_config changing time_zone from UTC (the default) to London"
6
+ when "London"
7
+ Rails.logger.info "govuk_app_config always sets time_zone to London - there is no need to set config.time_zone in your app"
8
+ else
9
+ raise "govuk_app_config prevents configuring time_zones other than London - config.time_zone was set to #{config.time_zone}"
10
+ end
11
+
12
+ config.time_zone = "London"
13
+ end
14
+ end
@@ -14,6 +14,10 @@ module GovukAppConfig
14
14
  end
15
15
  end
16
16
 
17
+ initializer "govuk_app_config.configure_timezone", before: "active_support.initialize_time_zone" do |app|
18
+ GovukTimezone.configure(app.config)
19
+ end
20
+
17
21
  config.before_initialize do
18
22
  GovukJsonLogging.configure if ENV["GOVUK_RAILS_JSON_LOGGING"]
19
23
  end
@@ -1,3 +1,3 @@
1
1
  module GovukAppConfig
2
- VERSION = "9.11.2".freeze
2
+ VERSION = "9.12.0".freeze
3
3
  end
@@ -9,5 +9,6 @@ require "govuk_app_config/govuk_prometheus_exporter"
9
9
  if defined?(Rails)
10
10
  require "govuk_app_config/govuk_json_logging"
11
11
  require "govuk_app_config/govuk_content_security_policy"
12
+ require "govuk_app_config/govuk_timezone"
12
13
  require "govuk_app_config/railtie"
13
14
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_app_config
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.11.2
4
+ version: 9.12.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: 2024-06-05 00:00:00.000000000 Z
11
+ date: 2024-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logstasher
@@ -33,7 +33,7 @@ dependencies:
33
33
  version: '0.25'
34
34
  - - "<"
35
35
  - !ruby/object:Gem::Version
36
- version: '0.27'
36
+ version: '0.29'
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '0.25'
44
44
  - - "<"
45
45
  - !ruby/object:Gem::Version
46
- version: '0.27'
46
+ version: '0.29'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: opentelemetry-instrumentation-all
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -53,7 +53,7 @@ dependencies:
53
53
  version: 0.39.1
54
54
  - - "<"
55
55
  - !ruby/object:Gem::Version
56
- version: 0.61.0
56
+ version: 0.62.0
57
57
  type: :runtime
58
58
  prerelease: false
59
59
  version_requirements: !ruby/object:Gem::Requirement
@@ -63,7 +63,7 @@ dependencies:
63
63
  version: 0.39.1
64
64
  - - "<"
65
65
  - !ruby/object:Gem::Version
66
- version: 0.61.0
66
+ version: 0.62.0
67
67
  - !ruby/object:Gem::Dependency
68
68
  name: opentelemetry-sdk
69
69
  requirement: !ruby/object:Gem::Requirement
@@ -372,6 +372,7 @@ files:
372
372
  - lib/govuk_app_config/govuk_proxy/static_proxy.rb
373
373
  - lib/govuk_app_config/govuk_puma.rb
374
374
  - lib/govuk_app_config/govuk_statsd.rb
375
+ - lib/govuk_app_config/govuk_timezone.rb
375
376
  - lib/govuk_app_config/railtie.rb
376
377
  - lib/govuk_app_config/version.rb
377
378
  homepage: https://github.com/alphagov/govuk_app_config
@@ -393,7 +394,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
393
394
  - !ruby/object:Gem::Version
394
395
  version: '0'
395
396
  requirements: []
396
- rubygems_version: 3.5.11
397
+ rubygems_version: 3.5.14
397
398
  signing_key:
398
399
  specification_version: 4
399
400
  summary: Base configuration for GOV.UK applications