akamai_ccu 1.5.7 → 1.5.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/akamai_ccu/response.rb +5 -1
- data/lib/akamai_ccu/version.rb +1 -1
- data/lib/akamai_ccu/wrapper.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 267c2f6feb51252b2b9cde5592d74f7ef81bf03c
|
4
|
+
data.tar.gz: '08ffb1b4e4fb3a01c556042c7188c67d51516051'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d87236050315502498f17f45eb7f5d18b915e27a17209eb2d4e8683cf480796c026d9c5a7bead5c575c04e0da6d35ab9c4323cde413dedc95bedc52ce40ffde
|
7
|
+
data.tar.gz: ccad81b10d6eb4b6caa64ab7271782fcdb081f0ba540258d9cdf5668017c06c02450b70d7858dc8ec42d66e7a17b7a0cd2ba5a1e01c034868800403703fd63d3
|
data/lib/akamai_ccu/response.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require "logger"
|
1
2
|
require "time"
|
2
3
|
|
3
4
|
module AkamaiCCU
|
@@ -6,7 +7,8 @@ module AkamaiCCU
|
|
6
7
|
|
7
8
|
attr_reader :body, :title, :status, :detail, :support_id, :purge_id, :decribed_by, :completion_at
|
8
9
|
|
9
|
-
def initialize(body
|
10
|
+
def initialize(body: {}, time: Time.now, logger: Logger.new(nil))
|
11
|
+
@logger = logger
|
10
12
|
@body = parse(body)
|
11
13
|
@title = @body["title"]
|
12
14
|
@status = @body.fetch("httpStatus") { @body.fetch("status", BAD_STATUS) }
|
@@ -36,6 +38,8 @@ module AkamaiCCU
|
|
36
38
|
private def parse(body)
|
37
39
|
return body if body.is_a? Hash
|
38
40
|
JSON.parse(body)
|
41
|
+
rescue JSON::ParserError => e
|
42
|
+
@logger.error { "reponse parse error: #{e.message}" }
|
39
43
|
end
|
40
44
|
end
|
41
45
|
end
|
data/lib/akamai_ccu/version.rb
CHANGED
data/lib/akamai_ccu/wrapper.rb
CHANGED
@@ -46,7 +46,7 @@ module AkamaiCCU
|
|
46
46
|
self.class.logger.debug { "request: uri=#{request.path}; body=#{request.body}; authorization=#{request["Authorization"]}" }
|
47
47
|
end
|
48
48
|
self.class.logger.info { "response: inspect=#{response.inspect}; body=#{response.body}" }
|
49
|
-
response_klass.new(response.body)
|
49
|
+
response_klass.new(body: response.body, logger: self.class.logger)
|
50
50
|
end
|
51
51
|
end
|
52
52
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: akamai_ccu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- costajob
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
11
|
+
date: 2017-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|