gds-api-adapters 47.0.0 → 47.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 99be45080ed4287d5b398d1ef0040dc61a74d822
4
- data.tar.gz: 13e88395ee04b4d40edd6f76912a946fbcd162c4
3
+ metadata.gz: 07a8872b59b834e53fb0e489fc1d739935fc7612
4
+ data.tar.gz: f6f1ff1b3e6f38c7b62925b580bb0f8c54ef6f69
5
5
  SHA512:
6
- metadata.gz: 3d56fdf001acca6e91cb36e0eb9ff850c1183b6e6d774ede515aa1482769ab9a05fad70cf225265442dd247b83790c10e7d34d0e246ecb64ef543437f6663f70
7
- data.tar.gz: 19920ce300008797ce38efcea67ce18897fbd2505216135f225c59e3cbccd78840b09f33ff89a6f80f6c6270fdcbc5933885dac7d3bb8a48d7c771a721cbb3e4
6
+ metadata.gz: 001b52990662be57cd02b0e163d651540789cb34a7d6ae7e726c461364180861d34b7316150215dc823191d72f9fe8c8afd50ccc0d8aa742e5b55ccc6deb59f8
7
+ data.tar.gz: 825e5e74f72b944b4fb64c139d0d079ec62a4523f94aa289ba403fdba92e84bd38e6f791956343eafdf63a64df081bdc438f89299ba578fc71dd21e1fae443ae
@@ -11,11 +11,13 @@ class GdsApi::LinkCheckerApi < GdsApi::Base
11
11
  # be within before doing another check. (optional)
12
12
  # @return [LinkReport] A +SimpleDelegator+ of the +GdsApi::Response+ which
13
13
  # responds to:
14
- # :uri the URI of the link
15
- # :status the status of the link, one of: ok, pending, broken, caution
16
- # :checked the date the link was checked
17
- # :errors a hash mapping short descriptions to arrays of long descriptions
18
- # :warnings a hash mapping short descriptions to arrays of long descriptions
14
+ # :uri the URI of the link
15
+ # :status the status of the link, one of: ok, pending, broken, caution
16
+ # :checked the date the link was checked
17
+ # :errors a list of error descriptions
18
+ # :warnings a list of warning descriptions
19
+ # :problem_summary a short description of the most critical problem with the link
20
+ # :suggested_fix where possible, this provides a potential fix for the problem
19
21
  #
20
22
  # @raise [HTTPErrorResponse] if the request returns an error
21
23
  def check(uri, synchronous: nil, checked_within: nil)
@@ -100,12 +102,20 @@ class GdsApi::LinkCheckerApi < GdsApi::Base
100
102
  Time.iso8601(self["checked"])
101
103
  end
102
104
 
105
+ def problem_summary
106
+ self["problem_summary"]
107
+ end
108
+
109
+ def suggested_fix
110
+ self["suggested_fix"]
111
+ end
112
+
103
113
  def errors
104
- self["errors"].each_with_object({}) { |(k, v), hash| hash[k.to_sym] = v }
114
+ self["errors"]
105
115
  end
106
116
 
107
117
  def warnings
108
- self["warnings"].each_with_object({}) { |(k, v), hash| hash[k.to_sym] = v }
118
+ self["warnings"]
109
119
  end
110
120
  end
111
121
 
@@ -5,13 +5,15 @@ module GdsApi
5
5
  module LinkCheckerApi
6
6
  LINK_CHECKER_API_ENDPOINT = Plek.current.find("link-checker-api")
7
7
 
8
- def link_checker_api_link_report_hash(uri:, status: :ok, checked: nil, errors: {}, warnings: {})
8
+ def link_checker_api_link_report_hash(uri:, status: :ok, checked: nil, errors: [], warnings: [], problem_summary: nil, suggested_fix: nil)
9
9
  {
10
10
  uri: uri,
11
11
  status: status,
12
12
  checked: checked || Time.now.iso8601,
13
13
  errors: errors,
14
14
  warnings: warnings,
15
+ problem_summary: problem_summary,
16
+ suggested_fix: suggested_fix,
15
17
  }
16
18
  end
17
19
 
@@ -25,9 +27,9 @@ module GdsApi
25
27
  }
26
28
  end
27
29
 
28
- def link_checker_api_check(uri:, status: :ok, checked: nil, errors: {}, warnings: {})
30
+ def link_checker_api_check(uri:, status: :ok, checked: nil, errors: [], warnings: [], problem_summary: nil, suggested_fix: nil)
29
31
  body = link_checker_api_link_report_hash(
30
- uri: uri, status: status, checked: checked, errors: errors, warnings: warnings
32
+ uri: uri, status: status, checked: checked, errors: errors, warnings: warnings, problem_summary: problem_summary, suggested_fix: suggested_fix,
31
33
  ).to_json
32
34
 
33
35
  stub_request(:get, "#{LINK_CHECKER_API_ENDPOINT}/check")
@@ -1,3 +1,3 @@
1
1
  module GdsApi
2
- VERSION = '47.0.0'.freeze
2
+ VERSION = '47.1.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gds-api-adapters
3
3
  version: !ruby/object:Gem::Version
4
- version: 47.0.0
4
+ version: 47.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Stewart
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-30 00:00:00.000000000 Z
11
+ date: 2017-07-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: plek