govuk_schemas 4.5.0 → 4.7.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: b7843ee3adf4523d3d0a0a8c722f5ae3175edaf3a4d1ee248a4fdafee9b596cf
4
- data.tar.gz: b04e4942d146c69782e5b0e70f2d441e0f4aa6822afa054ad78d77cd40aaab7f
3
+ metadata.gz: 34a97a974a896948c52a2e6f4c1460cfbeb931f6aa7ae0a9d148da7b1bb8a890
4
+ data.tar.gz: 46de32fac29ba1f29d0b7cc5da20e5e1fa4fe4a7e502912ffd94010b4e0489c3
5
5
  SHA512:
6
- metadata.gz: 14d5fb78761952ed355573bfd62c5cef13d2b723011a7bad969c5cf43926231e8a02af778aadcc514e73af3137703fa950b11264b90ac5111192c252f567f1f6
7
- data.tar.gz: 6e13df6f72f725fc504fb4151ca849dd2faeeae26c7d0c3f16f923ce3eec218293d3f66642d9237634c9666c481731f018b47df739ec8719929c82c1429b47dc
6
+ metadata.gz: f0da5f9cbaab5127de0a275b0ba156c76a3e65d84661ad8ae86a8bb8bee6764b35b6814a81360fa2d7755123834b327677eb465631205547956c116e7ad93614
7
+ data.tar.gz: 93ae4de1d68871747b69455b640df49d4c199032665f2fbf58c5632b0f405db2346450eb2520ff60689278419fec08ed927e5c3b505791bb7ccaec9ae2a8abc6
@@ -4,3 +4,7 @@ updates:
4
4
  directory: /
5
5
  schedule:
6
6
  interval: daily
7
+ - package-ecosystem: "github-actions"
8
+ directory: /
9
+ schedule:
10
+ interval: daily
@@ -1,4 +1,14 @@
1
- on: [push, pull_request]
1
+ on:
2
+ push:
3
+ branches:
4
+ - main
5
+ pull_request:
6
+ workflow_dispatch:
7
+ inputs:
8
+ ref:
9
+ description: 'The branch, tag or SHA to checkout'
10
+ default: main
11
+ type: string
2
12
 
3
13
  jobs:
4
14
  # This matrix job runs the test suite against multiple Ruby versions
@@ -7,15 +17,17 @@ jobs:
7
17
  fail-fast: false
8
18
  matrix:
9
19
  # 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 ]
20
+ ruby: ['3.0', 3.1, 3.2]
11
21
  runs-on: ubuntu-latest
12
22
  steps:
13
- - uses: actions/checkout@v2
23
+ - uses: actions/checkout@v4
24
+ with:
25
+ ref: ${{ inputs.ref || github.ref }}
14
26
  - name: Clone content-schemas
15
- uses: actions/checkout@v2
27
+ uses: actions/checkout@v4
16
28
  with:
17
29
  repository: alphagov/publishing-api
18
- ref: deployed-to-production
30
+ ref: main
19
31
  path: tmp/publishing-api
20
32
  - uses: ruby/setup-ruby@v1
21
33
  with:
@@ -39,6 +51,6 @@ jobs:
39
51
  if: ${{ github.ref == 'refs/heads/main' }}
40
52
  permissions:
41
53
  contents: write
42
- uses: alphagov/govuk-infrastructure/.github/workflows/publish-rubygem.yaml@main
54
+ uses: alphagov/govuk-infrastructure/.github/workflows/publish-rubygem.yml@main
43
55
  secrets:
44
56
  GEM_HOST_API_KEY: ${{ secrets.ALPHAGOV_RUBYGEMS_API_KEY }}
data/.gitignore CHANGED
@@ -1,7 +1,5 @@
1
1
  /.bundle/
2
- /.yardoc
3
2
  /Gemfile.lock
4
- /_yardoc/
5
3
  /coverage/
6
4
  /doc/
7
5
  /pkg/
data/.rubocop.yml CHANGED
@@ -1,6 +1,3 @@
1
1
  inherit_gem:
2
2
  rubocop-govuk:
3
3
  - config/default.yml
4
-
5
- AllCops:
6
- TargetRubyVersion: 2.6
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.7.6
1
+ 3.0.5
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ # 4.7.0
2
+
3
+ * Update `json-schema` dependency.
4
+
5
+ # 4.6.0
6
+
7
+ * Drop support for Ruby 2.7.
8
+ * Fix guidance on fixing a regex issue to reference correct filename.
9
+ * Add support for `^[1-9][0-9]{3}$` regex to resolve exceptions randomly generating specialist_documents.
10
+
1
11
  # 4.5.0
2
12
 
3
13
  General support for content schemas in publishing api:
data/README.md CHANGED
@@ -22,12 +22,6 @@ Make sure you have `publishing-api` cloned in a sibling directory:
22
22
  bundle exec rake
23
23
  ```
24
24
 
25
- ### Documentation
26
-
27
- To run a Yard server locally to preview documentation, run:
28
-
29
- $ bundle exec yard server --reload
30
-
31
25
  ## License
32
26
 
33
- The gem is available as open source under the terms of the [MIT License](LICENSE.md).
27
+ The gem is available as open source under the terms of the [MIT License](LICENCE).
@@ -19,14 +19,13 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = %w[lib]
20
20
 
21
21
  # This should be kept in sync with the json-schema version of publishing-api.
22
- spec.add_dependency "json-schema", ">= 2.8", "< 3.1"
22
+ spec.add_dependency "json-schema", ">= 2.8", "< 4.2"
23
23
 
24
24
  spec.add_development_dependency "climate_control"
25
25
  spec.add_development_dependency "pry-byebug"
26
26
  spec.add_development_dependency "rake", "~> 13.0"
27
27
  spec.add_development_dependency "rspec", "~> 3.4"
28
- spec.add_development_dependency "rubocop-govuk", "~> 4.0"
29
- spec.add_development_dependency "yard", "~> 0.8"
28
+ spec.add_development_dependency "rubocop-govuk", "4.12.0"
30
29
 
31
- spec.required_ruby_version = ">= 2.6"
30
+ spec.required_ruby_version = ">= 3.0"
32
31
  end
@@ -84,6 +84,8 @@ module GovukSchemas
84
84
  Date.today.iso8601
85
85
  when "^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$"
86
86
  Time.now.strftime("%H:%m")
87
+ when "^[1-9][0-9]{3}$"
88
+ rand(1000...9999).to_s
87
89
  when "^#.+$"
88
90
  anchor
89
91
  when "[a-z-]"
@@ -99,17 +101,16 @@ module GovukSchemas
99
101
  when '[a-z0-9\-_]'
100
102
  "#{hex}-#{hex}"
101
103
  else
102
- raise <<-DOC
104
+ raise <<~DOC
103
105
  Don't know how to generate random string for pattern #{pattern.inspect}
104
106
 
105
- This propably means you've introduced a new regex in publishing api.
106
- Because it's very hard to generate a valid string from a regex alone,
107
- we have to specify a method to generate random data for each regex in
108
- the schemas.
107
+ This probably means you've introduced a new regex in to a content
108
+ schema in Publishing API. Because it's very hard to generate a valid
109
+ string from a regex alone, we have to specify a method to generate
110
+ random data for each regex in the schemas.
109
111
 
110
- To fix this:
111
-
112
- - Add your regex to `lib/govuk_schemas/random.rb`
112
+ This can be fixed by adding your regex to `lib/govuk_schemas/random_content_generator.rb`
113
+ in https://github.com/alphagov/govuk_schemas
113
114
  DOC
114
115
  end
115
116
  end
@@ -38,7 +38,7 @@ module GovukSchemas
38
38
 
39
39
  def humanized_error(message)
40
40
  message.gsub("The property '#/'", "The item")
41
- .gsub(/in schema [0-9a-f\-]+/, "")
41
+ .gsub(/in schema [0-9a-f-]+/, "")
42
42
  .strip
43
43
  end
44
44
 
@@ -1,4 +1,4 @@
1
1
  module GovukSchemas
2
2
  # @private
3
- VERSION = "4.5.0".freeze
3
+ VERSION = "4.7.0".freeze
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_schemas
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.5.0
4
+ version: 4.7.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: 2022-11-23 00:00:00.000000000 Z
11
+ date: 2023-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json-schema
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '2.8'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '3.1'
22
+ version: '4.2'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '2.8'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '3.1'
32
+ version: '4.2'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: climate_control
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -90,30 +90,16 @@ dependencies:
90
90
  name: rubocop-govuk
91
91
  requirement: !ruby/object:Gem::Requirement
92
92
  requirements:
93
- - - "~>"
93
+ - - '='
94
94
  - !ruby/object:Gem::Version
95
- version: '4.0'
95
+ version: 4.12.0
96
96
  type: :development
97
97
  prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
- - - "~>"
101
- - !ruby/object:Gem::Version
102
- version: '4.0'
103
- - !ruby/object:Gem::Dependency
104
- name: yard
105
- requirement: !ruby/object:Gem::Requirement
106
- requirements:
107
- - - "~>"
108
- - !ruby/object:Gem::Version
109
- version: '0.8'
110
- type: :development
111
- prerelease: false
112
- version_requirements: !ruby/object:Gem::Requirement
113
- requirements:
114
- - - "~>"
100
+ - - '='
115
101
  - !ruby/object:Gem::Version
116
- version: '0.8'
102
+ version: 4.12.0
117
103
  description: Gem to generate test data based on GOV.UK content schemas
118
104
  email:
119
105
  - govuk-dev@digital.cabinet-office.gov.uk
@@ -130,7 +116,7 @@ files:
130
116
  - ".yardopts"
131
117
  - CHANGELOG.md
132
118
  - Gemfile
133
- - LICENSE.md
119
+ - LICENCE
134
120
  - README.md
135
121
  - Rakefile
136
122
  - bin/console
@@ -158,14 +144,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
158
144
  requirements:
159
145
  - - ">="
160
146
  - !ruby/object:Gem::Version
161
- version: '2.6'
147
+ version: '3.0'
162
148
  required_rubygems_version: !ruby/object:Gem::Requirement
163
149
  requirements:
164
150
  - - ">="
165
151
  - !ruby/object:Gem::Version
166
152
  version: '0'
167
153
  requirements: []
168
- rubygems_version: 3.3.26
154
+ rubygems_version: 3.4.19
169
155
  signing_key:
170
156
  specification_version: 4
171
157
  summary: Gem to generate test data based on GOV.UK content schemas
File without changes