slimmer 15.2.0 → 15.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/slimmer.rb +2 -1
- data/lib/slimmer/skin.rb +12 -4
- data/lib/slimmer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5423f67907cfbc074dcc3ec3be3763ee1b4de7194746d3465e2bd8962f131589
|
4
|
+
data.tar.gz: 9378a917a3a686ac18dda3d401596ff3c749f2c45897409cf9ca79af02d19005
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e5d62fedf19a951a60d82df37a9b3ca5258b2f46bc8e521e44050e00ff4755681f07ef6b5a540ea72702d5a5ae86fdd4792b86b9feeff07c1dd47dd075ea085
|
7
|
+
data.tar.gz: 79a18ae53ba25f1d3c3dacb186b1b7d239457b4a3201aad806aefad5547e55368021acdc94c46d35ad479686777c07ee88bf3a7a145237e7f64413b0bd13dd49
|
data/CHANGELOG.md
CHANGED
data/lib/slimmer.rb
CHANGED
@@ -45,6 +45,7 @@ module Slimmer
|
|
45
45
|
autoload :TitleInserter, "slimmer/processors/title_inserter"
|
46
46
|
end
|
47
47
|
|
48
|
-
class TemplateNotFoundException < StandardError; end
|
49
48
|
class CouldNotRetrieveTemplate < StandardError; end
|
49
|
+
class TemplateNotFoundException < CouldNotRetrieveTemplate; end
|
50
|
+
class IntermittentRetrievalError < CouldNotRetrieveTemplate; end
|
50
51
|
end
|
data/lib/slimmer/skin.rb
CHANGED
@@ -22,10 +22,18 @@ module Slimmer
|
|
22
22
|
def load_template(template_name)
|
23
23
|
url = template_url(template_name)
|
24
24
|
HTTPClient.get(url)
|
25
|
-
rescue RestClient::Exception => e
|
26
|
-
|
27
|
-
|
28
|
-
|
25
|
+
rescue Errno::ECONNREFUSED, SocketError, OpenSSL::SSL::SSLError, RestClient::Exception => e
|
26
|
+
message = "Unable to fetch: '#{template_name}' from '#{url}' because #{e}"
|
27
|
+
|
28
|
+
if e.is_a?(RestClient::Exception) && e.http_code == 404
|
29
|
+
raise TemplateNotFoundException, message, caller
|
30
|
+
end
|
31
|
+
|
32
|
+
if e.is_a?(RestClient::Exception) && [502, 503, 504].include?(e.http_code)
|
33
|
+
raise IntermittentRetrievalError, message, caller
|
34
|
+
end
|
35
|
+
|
36
|
+
raise CouldNotRetrieveTemplate, message, caller
|
29
37
|
end
|
30
38
|
|
31
39
|
def template_url(template_name)
|
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: 15.
|
4
|
+
version: 15.3.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: 2020-10
|
11
|
+
date: 2020-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|