moonrope-client 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/moonrope_client/connection.rb +5 -2
- data/lib/moonrope_client/request.rb +1 -1
- data/lib/moonrope_client/response.rb +7 -0
- data/lib/moonrope_client/responses/access_denied.rb +6 -2
- data/lib/moonrope_client/responses/parameter_error.rb +6 -2
- data/lib/moonrope_client/responses/validation_error.rb +6 -2
- data/lib/moonrope_client/version.rb +1 -1
- metadata +7 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 715eb9deabcf5fa5b513b07b25bd56622ee65f875e91c90e0213c5c3367af6c3
|
4
|
+
data.tar.gz: 2ffd7298b3c239781aab0466be505aee305e6606b393f989d6a7b2764e5653fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ffbaa74e05ae1d9089c95d1abc9bd764b07df63989628d8c65c9de517860f6305216be46be8cd1798aa176827793287173c09c734f85080eda98af51e431b6c5
|
7
|
+
data.tar.gz: cfd048af82d5e94625b7011d9cb2e2f1e0017974110bf1aaa7c6a0be2f79d5b779878defc2a649fe0f37a7b5c6850d9f1dc825078790bb5c73c75916994720a4
|
@@ -103,8 +103,11 @@ module MoonropeClient
|
|
103
103
|
result = connection.request(request)
|
104
104
|
case result.code.to_i
|
105
105
|
when 200 then result.body
|
106
|
-
when 400 then raise Error, "Bad request"
|
107
|
-
|
106
|
+
when 400 then raise Error, "Bad request (400)"
|
107
|
+
when 403 then raise Error, "Access denied (403)"
|
108
|
+
when 404 then raise Error, "Page not found (404)"
|
109
|
+
when 500 then raise Error, "Internal server error (500)"
|
110
|
+
else raise Error, "Unexpected status code #{result.code.to_i}"
|
108
111
|
end
|
109
112
|
end
|
110
113
|
|
@@ -29,7 +29,7 @@ module MoonropeClient
|
|
29
29
|
if result.success?
|
30
30
|
result
|
31
31
|
else
|
32
|
-
raise MoonropeClient::RequestError.new(result), "Request was not successful. Got #{result.class}"
|
32
|
+
raise MoonropeClient::RequestError.new(result), "Request was not successful. Got #{result.class} (#{result.exception_message})."
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
metadata
CHANGED
@@ -1,55 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: moonrope-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Cooke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.8'
|
20
17
|
- - ">="
|
21
18
|
- !ruby/object:Gem::Version
|
22
19
|
version: 1.8.0
|
20
|
+
- - "~>"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '1.8'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
|
-
- - "~>"
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '1.8'
|
30
27
|
- - ">="
|
31
28
|
- !ruby/object:Gem::Version
|
32
29
|
version: 1.8.0
|
33
|
-
- !ruby/object:Gem::Dependency
|
34
|
-
name: yard
|
35
|
-
requirement: !ruby/object:Gem::Requirement
|
36
|
-
requirements:
|
37
30
|
- - "~>"
|
38
31
|
- !ruby/object:Gem::Version
|
39
|
-
version: '
|
40
|
-
- - ">="
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
version: 0.8.0
|
43
|
-
type: :development
|
44
|
-
prerelease: false
|
45
|
-
version_requirements: !ruby/object:Gem::Requirement
|
46
|
-
requirements:
|
47
|
-
- - "~>"
|
48
|
-
- !ruby/object:Gem::Version
|
49
|
-
version: '0.8'
|
50
|
-
- - ">="
|
51
|
-
- !ruby/object:Gem::Version
|
52
|
-
version: 0.8.0
|
32
|
+
version: '1.8'
|
53
33
|
description: A full client library allows requests to made to Moonrope-enabled API
|
54
34
|
endpoints.
|
55
35
|
email:
|
@@ -90,10 +70,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
70
|
- !ruby/object:Gem::Version
|
91
71
|
version: '0'
|
92
72
|
requirements: []
|
93
|
-
|
94
|
-
rubygems_version: 2.5.1
|
73
|
+
rubygems_version: 3.0.6
|
95
74
|
signing_key:
|
96
75
|
specification_version: 4
|
97
76
|
summary: A client library for the the Moonrope API server.
|
98
77
|
test_files: []
|
99
|
-
has_rdoc:
|