trailer_vote-api 0.8.3 → 0.8.4
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/CHANGELOG.md +6 -0
- data/Gemfile.lock +3 -3
- data/lib/trailer_vote/api/errors.rb +14 -0
- data/lib/trailer_vote/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: 30fd6a22496288d0ac36a8705d983483ff073d54
|
|
4
|
+
data.tar.gz: f75c0572e46c36b13e1fe23a339b367806edfbaf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ce9a18a3f3c02b16beb3b0863f2d4b789b7fca8c888f80440b3009c2f97625af09136bf9290574ce3c14fda2a3c99a3fcc77142ff32d03f8c3a2be5fa9550110
|
|
7
|
+
data.tar.gz: e6bad4734d466fa15601cab2724a6f3a9bc5e96ca6a0d7788f61f18110feb68955063dd8dc769f2ffc6de1f9225d823fcf493f644fa8f227da86e5899a8e30d8
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
trailer_vote-api (0.8.
|
|
4
|
+
trailer_vote-api (0.8.4)
|
|
5
5
|
http (>= 3.3.0, < 4.x)
|
|
6
6
|
oj (>= 3.6, < 4.x)
|
|
7
7
|
trailer_vote-media_types (>= 0.6.1, < 1)
|
|
@@ -39,7 +39,7 @@ GEM
|
|
|
39
39
|
builder
|
|
40
40
|
minitest (>= 5.0)
|
|
41
41
|
ruby-progressbar
|
|
42
|
-
oj (3.6.
|
|
42
|
+
oj (3.6.13)
|
|
43
43
|
public_suffix (3.0.3)
|
|
44
44
|
rake (10.5.0)
|
|
45
45
|
ruby-progressbar (1.10.0)
|
|
@@ -49,7 +49,7 @@ GEM
|
|
|
49
49
|
json (>= 1.8, < 3)
|
|
50
50
|
simplecov-html (~> 0.10.0)
|
|
51
51
|
simplecov-html (0.10.2)
|
|
52
|
-
trailer_vote-media_types (0.8.
|
|
52
|
+
trailer_vote-media_types (0.8.1)
|
|
53
53
|
media_types (>= 0.6.0, < 1)
|
|
54
54
|
unf (0.1.4)
|
|
55
55
|
unf_ext
|
|
@@ -58,10 +58,22 @@ module TrailerVote
|
|
|
58
58
|
@data = { errors: [{ message: result.status.reason }] }
|
|
59
59
|
end
|
|
60
60
|
|
|
61
|
+
def status
|
|
62
|
+
result.status.to_i
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def inspect
|
|
66
|
+
format('[%<status>s] %<klazz>s' + "\n" + '%<messages>s', status: status, klazz: self.class.name, messages: messages)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
alias to_i status
|
|
70
|
+
alias to_s inspect
|
|
71
|
+
|
|
61
72
|
private
|
|
62
73
|
|
|
63
74
|
def formatted_data
|
|
64
75
|
return data if data.is_a?(::Hash)
|
|
76
|
+
|
|
65
77
|
{ errors: [{ message: String(data) }] }
|
|
66
78
|
end
|
|
67
79
|
end
|
|
@@ -74,6 +86,7 @@ module TrailerVote
|
|
|
74
86
|
class Conflict < ClientError; end
|
|
75
87
|
class Gone < ClientError; end
|
|
76
88
|
class PreconditionFailed < ClientError; end
|
|
89
|
+
class UnprocessableEntity < ClientError; end
|
|
77
90
|
class TooManyRequests < ClientError; end
|
|
78
91
|
|
|
79
92
|
class ServerError < ErrorsResponse; end
|
|
@@ -86,6 +99,7 @@ module TrailerVote
|
|
|
86
99
|
409 => Conflict,
|
|
87
100
|
410 => Gone,
|
|
88
101
|
412 => PreconditionFailed,
|
|
102
|
+
422 => UnprocessableEntity,
|
|
89
103
|
429 => TooManyRequests
|
|
90
104
|
).freeze
|
|
91
105
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: trailer_vote-api
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.8.
|
|
4
|
+
version: 0.8.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Derk-Jan Karrenbeld
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-10-
|
|
11
|
+
date: 2018-10-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: http
|