slimmer 16.0.0 → 16.0.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9fa11bce76f394cdd62bf87754f0a9fe701d12318de438129e6d09c8595ce6d
|
4
|
+
data.tar.gz: d12897d944a227f8bef8c7c07038136e598ac2ab6f285698d4a75a70855c716a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6bc30a38aa60c2582b5fb4b7fbdc9c542e4852f75941dc72edf783a145f9a347c4c2ac8afe454b4d130da4767cb22056cea63f6b6866c6cf080c521d0d95b90
|
7
|
+
data.tar.gz: 82a4a80af07e8c9554fab7934a02055b30f125a6239ee429375e7a16d893805ab3ad374f77ca2c4b76cacdba1a4d4010b80ea0c9cd760d4502712ad1bac4502c
|
data/CHANGELOG.md
CHANGED
@@ -5,21 +5,21 @@ module Slimmer::Processors
|
|
5
5
|
@app_name = app_name
|
6
6
|
end
|
7
7
|
|
8
|
-
def filter(
|
9
|
-
head =
|
8
|
+
def filter(_old_doc, new_doc)
|
9
|
+
head = new_doc.at_css("head")
|
10
10
|
|
11
|
-
add_meta_tag("analytics:organisations", @headers[Slimmer::Headers::ORGANISATIONS_HEADER], head)
|
12
|
-
add_meta_tag("analytics:world-locations", @headers[Slimmer::Headers::WORLD_LOCATIONS_HEADER], head)
|
13
|
-
add_meta_tag("format", @headers[Slimmer::Headers::FORMAT_HEADER], head)
|
14
|
-
add_meta_tag("search-result-count", @headers[Slimmer::Headers::RESULT_COUNT_HEADER], head)
|
15
|
-
add_meta_tag("rendering-application", @app_name, head)
|
11
|
+
add_meta_tag("analytics:organisations", @headers[Slimmer::Headers::ORGANISATIONS_HEADER], head, new_doc)
|
12
|
+
add_meta_tag("analytics:world-locations", @headers[Slimmer::Headers::WORLD_LOCATIONS_HEADER], head, new_doc)
|
13
|
+
add_meta_tag("format", @headers[Slimmer::Headers::FORMAT_HEADER], head, new_doc)
|
14
|
+
add_meta_tag("search-result-count", @headers[Slimmer::Headers::RESULT_COUNT_HEADER], head, new_doc)
|
15
|
+
add_meta_tag("rendering-application", @app_name, head, new_doc)
|
16
16
|
end
|
17
17
|
|
18
18
|
private
|
19
19
|
|
20
|
-
def add_meta_tag(name, content, head)
|
20
|
+
def add_meta_tag(name, content, head, doc)
|
21
21
|
if content
|
22
|
-
meta_node = Nokogiri::XML::Node.new("meta",
|
22
|
+
meta_node = Nokogiri::XML::Node.new("meta", doc)
|
23
23
|
meta_node["name"] = "govuk:#{name}"
|
24
24
|
meta_node["content"] = content
|
25
25
|
|
@@ -6,25 +6,25 @@ module Slimmer::Processors
|
|
6
6
|
@response = response
|
7
7
|
end
|
8
8
|
|
9
|
-
def filter(
|
10
|
-
search_form =
|
9
|
+
def filter(_old_doc, new_doc)
|
10
|
+
search_form = new_doc.at_css("form#search")
|
11
11
|
if search_parameters && search_form
|
12
12
|
search_parameters.each_pair do |name, value|
|
13
13
|
# Value can either be a string or an array of values
|
14
14
|
if value.is_a? Array
|
15
15
|
array_name = "#{name}[]"
|
16
16
|
value.each do |array_value|
|
17
|
-
add_hidden_input(search_form, array_name, array_value)
|
17
|
+
add_hidden_input(search_form, array_name, array_value, new_doc)
|
18
18
|
end
|
19
19
|
else
|
20
|
-
add_hidden_input(search_form, name, value)
|
20
|
+
add_hidden_input(search_form, name, value, new_doc)
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
def add_hidden_input(search_form, name, value)
|
27
|
-
element = Nokogiri::XML::Node.new("input",
|
26
|
+
def add_hidden_input(search_form, name, value, doc)
|
27
|
+
element = Nokogiri::XML::Node.new("input", doc)
|
28
28
|
element["type"] = "hidden"
|
29
29
|
element["name"] = name
|
30
30
|
element["value"] = value.to_s
|
data/lib/slimmer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slimmer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 16.0.
|
4
|
+
version: 16.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GOV.UK Dev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-01-
|
11
|
+
date: 2022-01-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|