yake 0.6.3 → 0.6.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 116618d14560cfc7f806d13c82a7dc6351717332b1ad82519599e62243a5e7a6
4
- data.tar.gz: 6230b5daaeeb799ba06ddf807ebb176bf692d9dd5fdb7c1beb235394d7087626
3
+ metadata.gz: e96eec76402a33ac4b0b57846ebfb90fcf22dd0adf3416cbd5acdf4b065f4675
4
+ data.tar.gz: 057c08011065fd17236d85d5327be67204af2c17e94c5c4af65de4fd4ed61941
5
5
  SHA512:
6
- metadata.gz: b40d42582e140d752fd3f6756d67ab023fc149b4606a23901461558384bd99569409e33d8330820eecbb15bc44fbedf65459300a93593245dc9402e0e8fee430
7
- data.tar.gz: 3c4dd2fb9c4c02172643a52e8dfa996607c4be5c69d1a93599b11b21d931a4d2c4402f7254e7ce3e3d1e2a79b4daa001dd7016f3d266aee1b60e245d22675acd
6
+ metadata.gz: 41435fce4006498e59c12939eb0b02a4b2c43ac2de2c892930ab38b0b5736c83a96922b28fb04b1a14530ed8deb35b849cfcb46ea38a90de71eb555e848897d7
7
+ data.tar.gz: 8ff001c1440a29f90440e120187c2df33f0f9fd72c693587b07654a6543a1d1bef585e0b03483100df5002b302d7bcf03874ce16a0380bd85b00e397d5992e18
data/lib/yake/errors.rb CHANGED
@@ -29,7 +29,7 @@ module Yake
29
29
  class RequestTimeout < Error; end # HTTP 408
30
30
  class Conflict < Error; end # HTTP 409
31
31
  class Gone < Error; end # HTTP 410
32
- class LengthRequired < Error; end # HTTP 410
32
+ class LengthRequired < Error; end # HTTP 411
33
33
  class PreconditionFailed < Error; end # HTTP 412
34
34
  class PayloadTooLarge < Error; end # HTTP 413
35
35
  class UriTooLong < Error; end # HTTP 414
@@ -58,6 +58,54 @@ module Yake
58
58
  class InsufficientStorage < Error; end # HTTP 507
59
59
  class LoopDetected < Error; end # HTTP 508
60
60
  class NotExtended < Error; end # HTTP 510
61
- class NetworkAuthenticationRequired < Error; end # HTTP 507
61
+ class NetworkAuthenticationRequired < Error; end # HTTP 511
62
+
63
+ ERRORS = {
64
+ '400' => BadRequest,
65
+ '401' => Unauthorized,
66
+ '402' => PaymentRequired,
67
+ '403' => Forbidden,
68
+ '404' => NotFound,
69
+ '405' => MethodNotAllowed,
70
+ '406' => NotAcceptable,
71
+ '407' => ProxyAuthenticationRequired,
72
+ '408' => RequestTimeout,
73
+ '409' => Conflict,
74
+ '410' => Gone,
75
+ '411' => LengthRequired,
76
+ '412' => PreconditionFailed,
77
+ '413' => PayloadTooLarge,
78
+ '414' => UriTooLong,
79
+ '415' => UnsupportedMediaType,
80
+ '416' => RangeNotSatisfiable,
81
+ '417' => ExpectationFailed,
82
+ '418' => ImATeapot,
83
+ '420' => EnhanceYourCalm,
84
+ '421' => MisdirectedRequest,
85
+ '422' => UnprocessableEntity,
86
+ '423' => Locked,
87
+ '424' => FailedDependency,
88
+ '425' => TooEarly,
89
+ '426' => UpgradeRequired,
90
+ '428' => PreconditionRequired,
91
+ '429' => TooManyRequests,
92
+ '431' => RequestHeaderFieldsTooLarge,
93
+ '451' => UnavailableForLegalReasons,
94
+ '500' => InternalServerError,
95
+ '501' => NotImplemented,
96
+ '502' => BadGateway,
97
+ '503' => ServiceUnavailable,
98
+ '504' => GatewayTimeout,
99
+ '505' => HttpVersionNotSupported,
100
+ '506' => VariantAlsoNegotiates,
101
+ '507' => InsufficientStorage,
102
+ '508' => LoopDetected,
103
+ '510' => NotExtended,
104
+ '511' => NetworkAuthenticationRequired,
105
+ }
106
+
107
+ def self.[](code)
108
+ ERRORS.fetch(code.to_s)
109
+ end
62
110
  end
63
111
  end
data/lib/yake/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Yake
4
- VERSION = '0.6.3'
4
+ VERSION = '0.6.4'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Mancevice
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-11 00:00:00.000000000 Z
11
+ date: 2022-08-12 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: