slimmer 18.5.1 → 18.6.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: 53bda50056426a6cc9b849df995c6aa2c82b0fad7bd2121d5347936786ff0cd3
4
- data.tar.gz: 9d8c0b2929a185f61d97f268e4e4b156e7ca5591030598c89769305f8427c1c9
3
+ metadata.gz: 929c5fc128e697424a5a97dde4a4fa38028936ae3d2243cce7bd6f9c06472437
4
+ data.tar.gz: 5a0edbbc1bbb1bf5a53409d1fa215a7f2d6fbc224e6c496e7d0e110c092f4b99
5
5
  SHA512:
6
- metadata.gz: 852952d3d2188a3930940640f5167904ebe8509a9ff6b2450980d5da4eeb2479f5f0fe039701d4d7217065d4ff2cdc84c2e547e19ba05881177141400eca5584
7
- data.tar.gz: 840403cd40c38716efa8b2da15cad73e3440ef021301e571dc0337510ab3b224fd516a2ca73191588f5ae54b766833bf59ec96e2123db585976ffea59415e7eb
6
+ metadata.gz: 5ff2f81108c967b67edd10428c266e21843cb16a1e4ce68b2068e7328537e9ba023e3934f0a7cade8d18fb5abb7f6884557f8d2e70ecb603fdb18b808d06268c
7
+ data.tar.gz: a6869381c29230dea482014b2a7e7efcf155ed9d9f069ad9a193e6a0b1050585b1a4f313adceb261b3feccb7a6b473323192781b473b0f3edadb9a50281fab1c
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ # 18.6.0
2
+
3
+ * Remove the part of the body from the error message for SourceWrapperNotFoundError and do some cleanup
4
+ Use more explanatory error message. Apply this globally to all apps.
5
+
6
+ # 18.5.2
7
+
8
+ * Fix a mistake in 18.5.1
9
+
1
10
  # 18.5.1
2
11
 
3
12
  * Include a part of the body in the error message text
@@ -10,7 +10,14 @@ module Slimmer::Processors
10
10
  source_markup = src.at_css(@source_selector)
11
11
  destination_markup = dest.at_css(@destination_selector)
12
12
 
13
- raise(Slimmer::SourceWrapperNotFoundError, "Source wrapper div not found", caller) if source_markup.nil? && wrapper_check?
13
+ if source_markup.nil?
14
+ raise(Slimmer::SourceWrapperNotFoundError, <<~ERROR_MESSAGE, caller)
15
+ Slimmer did not find a div with ID "wrapper" in the source HTML.
16
+ This could be because a request was made to your Rails application
17
+ for a format that it does not support. For example a JavaScript request,
18
+ when the application only has HTML templates.
19
+ ERROR_MESSAGE
20
+ end
14
21
 
15
22
  css_classes = []
16
23
  css_classes << source_markup.attributes["class"].to_s.split(/ +/) if source_markup.has_attribute?("class")
@@ -26,9 +33,5 @@ module Slimmer::Processors
26
33
  def is_gem_layout?
27
34
  @headers[Slimmer::Headers::TEMPLATE_HEADER]&.start_with?("gem_layout")
28
35
  end
29
-
30
- def wrapper_check?
31
- ENV["SLIMMER_WRAPPER_CHECK"] == "true"
32
- end
33
36
  end
34
37
  end
data/lib/slimmer/skin.rb CHANGED
@@ -100,7 +100,6 @@ module Slimmer
100
100
  end
101
101
 
102
102
  def success(source_request, response, body)
103
- original_body = body.dup
104
103
  wrapper_id = options[:wrapper_id] || "wrapper"
105
104
  template_wrapper_id = "wrapper" # All templates in Static use `#wrapper`
106
105
 
@@ -123,12 +122,6 @@ module Slimmer
123
122
 
124
123
  template_name = response.headers[Headers::TEMPLATE_HEADER] || "gem_layout"
125
124
  process(processors, body, template(template_name), source_request.env)
126
- rescue SourceWrapperNotFoundError => e
127
- message = "#{e.message} "\
128
- "at: #{source_request.base_url}#{source_request.path} "\
129
- "length: #{original_body.to_s.length} "\
130
- "body: original_body.to_s[0..2000]"
131
- raise SourceWrapperNotFoundError, message, caller
132
125
  end
133
126
  end
134
127
  end
@@ -1,3 +1,3 @@
1
1
  module Slimmer
2
- VERSION = "18.5.1".freeze
2
+ VERSION = "18.6.0".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: 18.5.1
4
+ version: 18.6.0
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: 2024-06-13 00:00:00.000000000 Z
11
+ date: 2024-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -170,14 +170,14 @@ dependencies:
170
170
  requirements:
171
171
  - - '='
172
172
  - !ruby/object:Gem::Version
173
- version: 4.18.0
173
+ version: 5.0.1
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - '='
179
179
  - !ruby/object:Gem::Version
180
- version: 4.18.0
180
+ version: 5.0.1
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: webmock
183
183
  requirement: !ruby/object:Gem::Requirement
@@ -251,7 +251,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
251
251
  - !ruby/object:Gem::Version
252
252
  version: '0'
253
253
  requirements: []
254
- rubygems_version: 3.5.11
254
+ rubygems_version: 3.5.14
255
255
  signing_key:
256
256
  specification_version: 4
257
257
  summary: Thinner than the skinner