govuk_document_types 0.3.0 → 0.4.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: 15817f7fe8f27f931fb48535729a5b2a8dc7932f9995cbe9f140014f6ca1bcc7
4
- data.tar.gz: 1353e369255cd95981df1b6e754b981e69082cd45887339dd9dbea3c06bd75f7
3
+ metadata.gz: 1922dc08fb0c3de03fdf25d1830ecc9503282d004060c5cce2fc6c34f02b68ef
4
+ data.tar.gz: e1de2739fb316b4753c11305871aaae4b62b4d15337c2e78a3f8a57ca9a36fa8
5
5
  SHA512:
6
- metadata.gz: 302b16424faab73c68816caacc20b320483907f9a3a26e4df4406096cfff7ecb72ee29965f31c6c5723d4aecaa0f56b18df6cea54282fc81ad60f78a324e859d
7
- data.tar.gz: 55711279e3813caacc5db86d887f6674546ce83f48b7295f90b76561cdcf28d729fac48653223b88316b1eff273803bb3effbb98fd43ff505e09ced4e198dca7
6
+ metadata.gz: 4985d4ba6dc37a177a2d3de627f0a5aed05235121c06ec2c2dc6ada5a90ce9f5e04f910b209a61aa9b922865303c79cb1d1970fad8520e15ba0f6b4a054f3f17
7
+ data.tar.gz: ad01c17d8993b84242431e9b56903e126d1ffdf9c1219758b67bcf1e1166b88ecf21149a777adf3c5bbef5d3b3cef352fed9a4a65e744515464f9942ddc9e0ab
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ # 0.4.0
2
+
3
+ * Adds `GovukDocumentTypes.supergroups(:ids)` as a way to retrieve
4
+ supergroups by ID.
5
+
1
6
  # 0.3.0
2
7
 
3
8
  * Add `content_purpose_supergroup` and `content_purpose_subgroup`
data/Jenkinsfile CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env groovy
2
2
 
3
+ library("govuk")
4
+
3
5
  node {
4
- def govuk = load '/var/lib/jenkins/groovy_scripts/govuk_jenkinslib.groovy'
5
6
  govuk.buildProject()
6
7
  }
data/data/supergroups.yml CHANGED
@@ -27,23 +27,21 @@ content_purpose_supergroup:
27
27
  - research_and_data
28
28
 
29
29
  documentation : |
30
- ##Content Purpose Supergroups
31
-
32
30
  These are the grouping that the navigation team came up with
33
31
  as a result of an investigation done using the "Jobs to be Done" framework in Q4.
34
32
 
35
- There are 5 high level Content Purpose Supergroups which each group together some subgroups
36
- which in turn group `document_types`.
33
+ There are 5 high level Content Purpose Supergroups which each group together some Content Purpose Subgroups.
37
34
 
38
35
  More information about the JTBD framework and the supergroups can be found on the
39
36
  [GovUK wiki](https://gov-uk.atlassian.net/wiki/spaces/GFED/pages/305201156/Document+type+groupings)
40
37
 
41
38
  The list of which document types are grouped by both supergroups and subgroups can be
42
- found in the [supertypes.yml](./supertypes.yml) file.
39
+ found in the [supertypes.yml](https://github.com/alphagov/govuk_document_types/blob/master/data/supertypes.yml) file.
43
40
 
44
- The list of the subgroups grouped by supergroup are in the file [supergroups.yml](./supergroups.yml).
41
+ The list of the subgroups grouped by supergroup are in the file
42
+ [supergroups.yml](https://github.com/alphagov/govuk_document_types/blob/master/data/supergroups.yml).
45
43
  If you want to make a change to the `document_type` groupings in the sub or supergroups, you must make the
46
44
  relevant change in both groups and both files to make sure there are no discrepancies between the groups.
47
45
 
48
- To make sure that your changes were correct, run the data linting test in the
49
- [data_lint_spec.rb](../spec/data_lint_spec.rb) file.
46
+ To make sure that your changes were correct, run the data linting tests in
47
+ [data_lint_spec.rb](https://github.com/alphagov/govuk_document_types/blob/master/spec/data_lint_spec.rb).
@@ -3,6 +3,7 @@ require "yaml"
3
3
 
4
4
  module GovukDocumentTypes
5
5
  DATA = YAML.load_file(File.dirname(__FILE__) + "/../data/supertypes.yml")
6
+ SUPERGROUPS = YAML.load_file(File.dirname(__FILE__) + "/../data/supergroups.yml")
6
7
 
7
8
  def self.supertypes(document_type:)
8
9
  types = {}
@@ -18,4 +19,9 @@ module GovukDocumentTypes
18
19
 
19
20
  types
20
21
  end
22
+
23
+ def self.supergroups(ids:)
24
+ groups = SUPERGROUPS["content_purpose_supergroup"]["items"]
25
+ groups.select { |g| ids.include?(g["id"]) }
26
+ end
21
27
  end
@@ -1,3 +1,3 @@
1
1
  module GovukDocumentTypes
2
- VERSION = "0.3.0".freeze
2
+ VERSION = "0.4.0".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_document_types
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.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: 2018-02-27 00:00:00.000000000 Z
11
+ date: 2018-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake