trailer_vote-api 0.8.3 → 0.8.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dd4ad9b6f52cdb85e1ccfda2c56f47483326b7af
4
- data.tar.gz: 9647720f9c87abf3e54cc0e8c1682f1fec0b3eff
3
+ metadata.gz: 30fd6a22496288d0ac36a8705d983483ff073d54
4
+ data.tar.gz: f75c0572e46c36b13e1fe23a339b367806edfbaf
5
5
  SHA512:
6
- metadata.gz: ca335c29541ad3333016bdf76abfaee34a73819599e5ff825c55ef04cbeac59b66add6e3efed6300fa2c768fdbc6a8f9be81f88262375cf38b7320d26e625d30
7
- data.tar.gz: 9e3fa02068a7d4e94c3d40e11d64f6d9b05052fc26bdacd9d362292ba30c2388133805baea0ac89db4a7a68d93a87518ea37adf524d5192e4d21a1ee1261a174
6
+ metadata.gz: ce9a18a3f3c02b16beb3b0863f2d4b789b7fca8c888f80440b3009c2f97625af09136bf9290574ce3c14fda2a3c99a3fcc77142ff32d03f8c3a2be5fa9550110
7
+ data.tar.gz: e6bad4734d466fa15601cab2724a6f3a9bc5e96ca6a0d7788f61f18110feb68955063dd8dc769f2ffc6de1f9225d823fcf493f644fa8f227da86e5899a8e30d8
@@ -1,3 +1,9 @@
1
+ # 0.8.4
2
+
3
+ - Add `#inspect` and `#to_s` to response errors
4
+ - Add `#status` and `#to_i` to response errors
5
+ - Add `UnprocessibleEntity` as defined response error (`ClientError`)
6
+
1
7
  # 0.8.3
2
8
 
3
9
  - Add `Issue` media create API
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- trailer_vote-api (0.8.3)
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.12)
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.0)
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
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module TrailerVote
4
4
  module Api
5
- VERSION = '0.8.3'
5
+ VERSION = '0.8.4'
6
6
  end
7
7
  end
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.3
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-21 00:00:00.000000000 Z
11
+ date: 2018-10-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http