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 +4 -4
- data/lib/gds_api/link_checker_api.rb +17 -7
- data/lib/gds_api/test_helpers/link_checker_api.rb +5 -3
- data/lib/gds_api/version.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: 07a8872b59b834e53fb0e489fc1d739935fc7612
|
4
|
+
data.tar.gz: f6f1ff1b3e6f38c7b62925b580bb0f8c54ef6f69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
15
|
-
# :status
|
16
|
-
# :checked
|
17
|
-
# :errors
|
18
|
-
# :warnings
|
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"]
|
114
|
+
self["errors"]
|
105
115
|
end
|
106
116
|
|
107
117
|
def warnings
|
108
|
-
self["warnings"]
|
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:
|
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:
|
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")
|
data/lib/gds_api/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2017-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: plek
|