activeresource 6.1.1 → 6.1.2

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
  SHA256:
3
- metadata.gz: 95f17d4e9c32ac07705fd268b64bc8d2dbdff491b948c87339ab8b7bd054163e
4
- data.tar.gz: 9b7ec268d567d641a25608f31d29e8a5675c8436b89448eaecd7a1e179dff587
3
+ metadata.gz: aa6762874a2653d8a08929aa62b286ee759384949026c7229f792208a18e1a4e
4
+ data.tar.gz: b1bbe54d2cd8937cb58ba46ebd6c38bae69d937c8663f2f77e2d266011c68216
5
5
  SHA512:
6
- metadata.gz: 789a6c7d3dd6044c806e8496ebcdf422f0c8c21e64dc42d6e0352781b96070b8f190b0a42ce8171f920bd9d1057969f4599ef150c7be334da59e89c2d4ac10fb
7
- data.tar.gz: 29df5673ea2374cfa8a282b47bce5ca4d800744add388ddd8baaab0d3fd157a835361049213b4640aeac5697a86b94247c407c1b19dcedd552c4d77bb15fa6bc
6
+ metadata.gz: 4bfa1af456b2b740e5472f2ce9c5a6138cbfb5449ec3480a6f637c2f75495d66da591fdd80f4e6c5092afeba3af6439545c7c5e7a75af187a981ef922ece053a
7
+ data.tar.gz: 17d6eb6cd168d7c5613a9ef594648529f9fc6b6bdec7927d7940d62012c0b75e9adb92c3c22f6790f725049bf2d6dbd86bd6082eb25d7145a9b2bcedd4f0e80b
@@ -212,6 +212,7 @@ module ActiveResource
212
212
  # * 301, 302, 303, 307 - ActiveResource::Redirection
213
213
  # * 400 - ActiveResource::BadRequest
214
214
  # * 401 - ActiveResource::UnauthorizedAccess
215
+ # * 402 - ActiveResource::PaymentRequired
215
216
  # * 403 - ActiveResource::ForbiddenAccess
216
217
  # * 404 - ActiveResource::ResourceNotFound
217
218
  # * 405 - ActiveResource::MethodNotAllowed
@@ -139,6 +139,8 @@ module ActiveResource
139
139
  raise(BadRequest.new(response))
140
140
  when 401
141
141
  raise(UnauthorizedAccess.new(response))
142
+ when 402
143
+ raise(PaymentRequired.new(response))
142
144
  when 403
143
145
  raise(ForbiddenAccess.new(response))
144
146
  when 404
@@ -57,6 +57,10 @@ module ActiveResource
57
57
  class UnauthorizedAccess < ClientError # :nodoc:
58
58
  end
59
59
 
60
+ # 402 Payment Required
61
+ class PaymentRequired < ClientError # :nodoc:
62
+ end
63
+
60
64
  # 403 Forbidden
61
65
  class ForbiddenAccess < ClientError # :nodoc:
62
66
  end
@@ -21,5 +21,9 @@ module ActiveResource
21
21
  app.config.active_job.custom_serializers << ActiveResource::ActiveJobSerializer
22
22
  end
23
23
  end
24
+
25
+ initializer "active_resource.deprecator" do |app|
26
+ app.deprecators[:active_resource] = ActiveResource.deprecator
27
+ end
24
28
  end
25
29
  end
@@ -57,7 +57,7 @@ module ActiveResource
57
57
  errors = decoded["errors"] || {}
58
58
  if errors.kind_of?(Array)
59
59
  # 3.2.1-style with array of strings
60
- ActiveSupport::Deprecation.warn("Returning errors as an array of strings is deprecated.")
60
+ ActiveResource.deprecator.warn("Returning errors as an array of strings is deprecated.")
61
61
  from_array errors, save_cache
62
62
  else
63
63
  # 3.2.2+ style
@@ -65,7 +65,7 @@ module ActiveResource
65
65
  end
66
66
  else
67
67
  # <3.2-style respond_with - lacks 'errors' key
68
- ActiveSupport::Deprecation.warn('Returning errors as a hash without a root "errors" key is deprecated.')
68
+ ActiveResource.deprecator.warn('Returning errors as a hash without a root "errors" key is deprecated.')
69
69
  from_hash decoded, save_cache
70
70
  end
71
71
  end
@@ -4,7 +4,7 @@ module ActiveResource
4
4
  module VERSION # :nodoc:
5
5
  MAJOR = 6
6
6
  MINOR = 1
7
- TINY = 1
7
+ TINY = 2
8
8
  PRE = nil
9
9
 
10
10
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
@@ -46,6 +46,16 @@ module ActiveResource
46
46
  autoload :InheritingHash
47
47
  autoload :Validations
48
48
  autoload :Collection
49
+
50
+ if ActiveSupport::VERSION::STRING >= "7.2"
51
+ def self.deprecator
52
+ @deprecator ||= ActiveSupport::Deprecation.new(VERSION::STRING, "ActiveResource")
53
+ end
54
+ else
55
+ def self.deprecator
56
+ ActiveSupport::Deprecation
57
+ end
58
+ end
49
59
  end
50
60
 
51
61
  require "active_resource/railtie" if defined?(Rails.application)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeresource
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.1.1
4
+ version: 6.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-09 00:00:00.000000000 Z
11
+ date: 2024-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -135,9 +135,9 @@ licenses:
135
135
  - MIT
136
136
  metadata:
137
137
  bug_tracker_uri: https://github.com/rails/activeresource/issues
138
- changelog_uri: https://github.com/rails/activeresource/releases/tag/v6.1.1
138
+ changelog_uri: https://github.com/rails/activeresource/releases/tag/v6.1.2
139
139
  documentation_uri: http://rubydoc.info/gems/activeresource
140
- source_code_uri: https://github.com/rails/activeresource/tree/v6.1.1
140
+ source_code_uri: https://github.com/rails/activeresource/tree/v6.1.2
141
141
  rubygems_mfa_required: 'true'
142
142
  post_install_message:
143
143
  rdoc_options: []