gds-api-adapters 1.9.1 → 1.9.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/gds_api/test_helpers/content_api.rb +9 -1
- data/lib/gds_api/version.rb +1 -1
- metadata +4 -4
@@ -83,6 +83,14 @@ module GdsApi
|
|
83
83
|
artefact
|
84
84
|
end
|
85
85
|
|
86
|
+
def artefact_for_slug_in_a_subsection(slug, subsection_slug)
|
87
|
+
artefact = artefact_for_slug(slug)
|
88
|
+
base_section = tag_for_slug(subsection_slug.split('/').first, "section")
|
89
|
+
section = tag_for_slug(subsection_slug, "section").merge("parent" => base_section)
|
90
|
+
artefact["tags"] << section
|
91
|
+
artefact
|
92
|
+
end
|
93
|
+
|
86
94
|
def artefact_for_slug_with_related_artefacts(slug, related_artefact_slugs)
|
87
95
|
artefact = artefact_for_slug(slug)
|
88
96
|
artefact["related"] = related_artefact_slugs.map do |related_slug|
|
@@ -98,7 +106,7 @@ module GdsApi
|
|
98
106
|
|
99
107
|
def tag_for_slug(slug, tag_type)
|
100
108
|
{
|
101
|
-
"title" => titleize_slug(slug),
|
109
|
+
"title" => titleize_slug(slug.split('/').last),
|
102
110
|
"id" => "https://contentapi.test.alphagov.co.uk/tags/#{CGI.escape(slug)}.json",
|
103
111
|
"details" => {
|
104
112
|
"type" => tag_type
|
data/lib/gds_api/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: gds-api-adapters
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.9.
|
5
|
+
version: 1.9.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- James Stewart
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2012-09-
|
13
|
+
date: 2012-09-13 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: plek
|
@@ -202,7 +202,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
202
202
|
requirements:
|
203
203
|
- - ">="
|
204
204
|
- !ruby/object:Gem::Version
|
205
|
-
hash:
|
205
|
+
hash: 2434091861084396613
|
206
206
|
segments:
|
207
207
|
- 0
|
208
208
|
version: "0"
|
@@ -211,7 +211,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
211
211
|
requirements:
|
212
212
|
- - ">="
|
213
213
|
- !ruby/object:Gem::Version
|
214
|
-
hash:
|
214
|
+
hash: 2434091861084396613
|
215
215
|
segments:
|
216
216
|
- 0
|
217
217
|
version: "0"
|