semaphore_client 2.4.0 → 2.5.0

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: 6d4ea7977e94aa5c80b02123679165c5cc3f6720
4
- data.tar.gz: 147e7c0565697549c42bf2b4193e98e8045a525c
3
+ metadata.gz: e6d4c0a4082eacb1e30c4c17c06d8b58b3addaf4
4
+ data.tar.gz: 1046b7f04b0edb7823b79ba55bd2d0bf195f7822
5
5
  SHA512:
6
- metadata.gz: e7c4bf97917f9d10322bf30dddee91be955aff962ce42baa3214c821b80a8b62b94a9a9ce1d95852884822ce225b237b842f1bcdf284ddd4ca480cb2440402d8
7
- data.tar.gz: 9b654def04a757c7b531dbbbe85ae4faebb547ff9c545bfbb026d47285178e508e92e3513dfea2ea681dc6b8066c3cd329c8e0cb5e19d17f0231d871404be78b
6
+ metadata.gz: cef6ebcf123d8ab3fdb7494d0176ac9a76cc16bfe8d46acb9e14205cb00a58a35a63ef807c25479d6fe34fae97326cdb483657167f784a79ad377c5b4121b592
7
+ data.tar.gz: 008885de133cbfbf9640f5b45e4a4039bf0f0924bac45ab8242107902a3c20c70421a68cf278f81ff86517ac52a56785402e5a67c3f348c23de429bcddd42282
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- semaphore_client (2.4.0)
4
+ semaphore_client (2.5.0)
5
5
  faraday
6
6
 
7
7
  GEM
@@ -1,5 +1,7 @@
1
1
  class SemaphoreClient
2
2
  class Exceptions
3
+ ApiError = Struct.new(:resource, :field, :code)
4
+
3
5
  class Base < StandardError; end
4
6
 
5
7
  class AttributeNotAvailable < Base; end
@@ -30,7 +32,11 @@ class SemaphoreClient
30
32
  class Conflict < ResponseError; end
31
33
 
32
34
  # 422
33
- class UnprocessableEntity < ResponseError; end
35
+ class UnprocessableEntity < ResponseError
36
+ def errors
37
+ JSON.parse(@env[:body])["erorrs"].map { |error| ApiError.new(error) }
38
+ end
39
+ end
34
40
 
35
41
  # 500+
36
42
  class ServerError < ResponseError; end
@@ -1,3 +1,3 @@
1
1
  class SemaphoreClient
2
- VERSION = "2.4.0"
2
+ VERSION = "2.5.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: semaphore_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jovan Ivanović
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-09-27 00:00:00.000000000 Z
11
+ date: 2017-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday