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 +4 -4
- data/.github/dependabot.yml +4 -0
- data/.github/workflows/ci.yml +18 -6
- data/.gitignore +0 -2
- data/.rubocop.yml +0 -3
- data/.ruby-version +1 -1
- data/CHANGELOG.md +10 -0
- data/README.md +1 -7
- data/govuk_schemas.gemspec +3 -4
- data/lib/govuk_schemas/random_content_generator.rb +9 -8
- data/lib/govuk_schemas/validator.rb +1 -1
- data/lib/govuk_schemas/version.rb +1 -1
- metadata +11 -25
- /data/{LICENSE.md → LICENCE} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34a97a974a896948c52a2e6f4c1460cfbeb931f6aa7ae0a9d148da7b1bb8a890
|
4
|
+
data.tar.gz: 46de32fac29ba1f29d0b7cc5da20e5e1fa4fe4a7e502912ffd94010b4e0489c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0da5f9cbaab5127de0a275b0ba156c76a3e65d84661ad8ae86a8bb8bee6764b35b6814a81360fa2d7755123834b327677eb465631205547956c116e7ad93614
|
7
|
+
data.tar.gz: 93ae4de1d68871747b69455b640df49d4c199032665f2fbf58c5632b0f405db2346450eb2520ff60689278419fec08ed927e5c3b505791bb7ccaec9ae2a8abc6
|
data/.github/dependabot.yml
CHANGED
data/.github/workflows/ci.yml
CHANGED
@@ -1,4 +1,14 @@
|
|
1
|
-
on:
|
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: [
|
20
|
+
ruby: ['3.0', 3.1, 3.2]
|
11
21
|
runs-on: ubuntu-latest
|
12
22
|
steps:
|
13
|
-
- uses: actions/checkout@
|
23
|
+
- uses: actions/checkout@v4
|
24
|
+
with:
|
25
|
+
ref: ${{ inputs.ref || github.ref }}
|
14
26
|
- name: Clone content-schemas
|
15
|
-
uses: actions/checkout@
|
27
|
+
uses: actions/checkout@v4
|
16
28
|
with:
|
17
29
|
repository: alphagov/publishing-api
|
18
|
-
ref:
|
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.
|
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
data/.rubocop.yml
CHANGED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
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](
|
27
|
+
The gem is available as open source under the terms of the [MIT License](LICENCE).
|
data/govuk_schemas.gemspec
CHANGED
@@ -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", "<
|
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", "
|
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 = ">=
|
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
|
104
|
+
raise <<~DOC
|
103
105
|
Don't know how to generate random string for pattern #{pattern.inspect}
|
104
106
|
|
105
|
-
This
|
106
|
-
Because it's very hard to generate a valid
|
107
|
-
we have to specify a method to generate
|
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
|
-
|
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
|
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.
|
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:
|
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: '
|
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: '
|
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:
|
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:
|
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
|
-
-
|
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: '
|
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.
|
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
|
/data/{LICENSE.md → LICENCE}
RENAMED
File without changes
|