restful_resource 2.16.0 → 2.17.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
  SHA256:
3
- metadata.gz: 9f8db280a4d7afd8d96673bd146fc9ef8f07b65892c51510b96528cf14da3ef6
4
- data.tar.gz: 90117d3293b54c29bd95e898e74c5bf4a36729aa3699febefe1611f7c0edd2b3
3
+ metadata.gz: 4f1e1688884fd8954caa9da4cef1a9d2c3a1e294ded09414ce82a3865cf40e30
4
+ data.tar.gz: cb8672227647b41612c0a6a9ba739dde8705fb353369347106b037cc4c2a45c2
5
5
  SHA512:
6
- metadata.gz: c75d4f211b12a0ba6a80911d86797317332343d36e293f4374612877c2e154ab963a45bc20a4916e8868c8c37b68c3d6d1716e97542ee7898c72622c539b648c
7
- data.tar.gz: ced11a5b38856a0401f9380dcada04089ed5ac929f275a1bef34b13906944357c874ba7395e88a661cbcc791119920967c0c7736151c2c10dc1a328439e46545
6
+ metadata.gz: 676a02c4acb372b64b6a82e628cef146a2043709cecb56a9819e37ce253d15af0f386db2a9d6e08a5c9b02d5e7e8895b61e88af7065f560c941ccad1400a8daa
7
+ data.tar.gz: e5ebf7348404ce117ac51963c23969754adbc144fbd97cc8ee4a967a80fe8c0a1a162ce55824800f5afd321167efe240fdb97226d05ded37fb74ba67209d6f4d
data/CHANGELOG.md CHANGED
@@ -1,4 +1,9 @@
1
1
  # Changelog
2
+ 2.17
3
+ ---
4
+
5
+ - Re-add deprecation for :dig and :[] since they are still used by some clients
6
+
2
7
  2.16
3
8
  ---
4
9
 
@@ -2,6 +2,8 @@ module RestfulResource
2
2
  class Base < OpenObject
3
3
  extend RestfulResource::Associations
4
4
 
5
+ Deprecator = ActiveSupport::Deprecation.new('soon', 'restful_resource')
6
+
5
7
  def self.configure(base_url: nil,
6
8
  username: nil,
7
9
  password: nil,
@@ -0,0 +1,7 @@
1
+ module RestfulResource
2
+ class Railtie < Rails::Railtie
3
+ initializer 'restful_resource.deprecator' do |app|
4
+ app.deprecators[:restful_resource] = Base::Deprecator
5
+ end
6
+ end
7
+ end
@@ -1,5 +1,5 @@
1
1
  module RestfulResource
2
2
  class StrictOpenStruct < ::OpenStruct
3
- undef_method :dig, :[]
3
+ deprecate :dig, :[], deprecator: Base::Deprecator
4
4
  end
5
5
  end
@@ -1,3 +1,3 @@
1
1
  module RestfulResource
2
- VERSION = '2.16.0'.freeze
2
+ VERSION = '2.17.0'.freeze
3
3
  end
@@ -24,3 +24,4 @@ require_relative 'restful_resource/redirections'
24
24
  require_relative 'restful_resource/instrumentation'
25
25
  require_relative 'restful_resource/base'
26
26
  require_relative 'restful_resource/strict_open_struct'
27
+ require_relative 'restful_resource/railtie' if defined?(Rails::Railtie)
@@ -4,14 +4,18 @@ RSpec.describe RestfulResource::StrictOpenStruct do
4
4
  let(:instance) { described_class.new(foo: 'bar') }
5
5
 
6
6
  describe '#dig' do
7
- it 'is not defined' do
8
- expect { instance.dig(:foo) }.to raise_error(NoMethodError)
7
+ it 'is deprecated' do
8
+ expect { instance.dig(:foo) }.to output(
9
+ /dig is deprecated and will be removed from restful_resource soon/
10
+ ).to_stderr
9
11
  end
10
12
  end
11
13
 
12
14
  describe '#[]' do
13
- it 'is not defined' do
14
- expect { instance[:foo] }.to raise_error(NoMethodError)
15
+ it 'is deprecated' do
16
+ expect { instance[:foo] }.to output(
17
+ /\[\] is deprecated and will be removed from restful_resource soon/
18
+ ).to_stderr
15
19
  end
16
20
  end
17
21
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: restful_resource
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.16.0
4
+ version: 2.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Santoro
@@ -273,6 +273,7 @@ files:
273
273
  - lib/restful_resource/paginated_array.rb
274
274
  - lib/restful_resource/parameter_missing_error.rb
275
275
  - lib/restful_resource/rails_validations.rb
276
+ - lib/restful_resource/railtie.rb
276
277
  - lib/restful_resource/redirections.rb
277
278
  - lib/restful_resource/request.rb
278
279
  - lib/restful_resource/resource_id_missing_error.rb