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: 118378e1ad3f656164da144437d42085b0e7d69ffc567d922266e531001aeab5
4
- data.tar.gz: e96c1f6bd1fe7d479a217dfa6ec3c76793c140063377d146bc418e0756f46dea
3
+ metadata.gz: b9fa11bce76f394cdd62bf87754f0a9fe701d12318de438129e6d09c8595ce6d
4
+ data.tar.gz: d12897d944a227f8bef8c7c07038136e598ac2ab6f285698d4a75a70855c716a
5
5
  SHA512:
6
- metadata.gz: 0fd17a9971da4ab0c6d43883b9ce7cff0556384e1470c9c26dc4c6e1c97e9a9c7510fd5b938a315d8ead09cb70af05e0e644257849aa15c950bdc31cc6ad373d
7
- data.tar.gz: 76d732124e4efc8ec9b62c5ea7747a5316f740f38f2f9e80595bcda08ab3c864bf1bbe89985cade4ee2cdec10d70b866ac081e2b482f851ec7135c5660580c21
6
+ metadata.gz: f6bc30a38aa60c2582b5fb4b7fbdc9c542e4852f75941dc72edf783a145f9a347c4c2ac8afe454b4d130da4767cb22056cea63f6b6866c6cf080c521d0d95b90
7
+ data.tar.gz: 82a4a80af07e8c9554fab7934a02055b30f125a6239ee429375e7a16d893805ab3ad374f77ca2c4b76cacdba1a4d4010b80ea0c9cd760d4502712ad1bac4502c
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ # 16.0.1
2
+ * Resolve Nokogiri deprecation warning (#277)
3
+
1
4
  # 16.0.0
2
5
  * BREAKING: Remove NavigationMover processor (#275)
3
6
 
@@ -5,21 +5,21 @@ module Slimmer::Processors
5
5
  @app_name = app_name
6
6
  end
7
7
 
8
- def filter(_src, dest)
9
- head = dest.at_css("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", head)
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(_content_document, page_template)
10
- search_form = page_template.at_css("form#search")
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", search_form)
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
@@ -1,3 +1,3 @@
1
1
  module Slimmer
2
- VERSION = "16.0.0".freeze
2
+ VERSION = "16.0.1".freeze
3
3
  end
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.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-24 00:00:00.000000000 Z
11
+ date: 2022-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport