restful_resource 2.12.0 → 2.12.1
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 +4 -4
- data/Gemfile.lock +2 -2
- data/lib/restful_resource.rb +1 -0
- data/lib/restful_resource/deprecator.rb +25 -0
- data/lib/restful_resource/strict_open_struct.rb +1 -1
- data/lib/restful_resource/version.rb +1 -1
- data/spec/restful_resource/strict_open_struct_spec.rb +21 -0
- data/spec/spec_helper.rb +1 -0
- metadata +6 -3
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 6d99c38a79730e832e99b155798ae920f45eed26dd44435ce71efcb58fd6094c
         | 
| 4 | 
            +
              data.tar.gz: 46ea4b63768ee7cf60ee5aa33fe02c96f5e715e6512d0a0cff38483ff975325b
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: fc155eb1cd1fd0d3e70654dd6d5b4b6824409533f8d3d72a0aed79eca56501b8eea9745732fb7fd26406df9051edfde3a20fe31e9042666cfe1b7f8e47b7a735
         | 
| 7 | 
            +
              data.tar.gz: 9f7bb0b92f5dcff2161547829cc4b798d00e5ac1a614559e6785dee231a0a4552e54998d927c8d947dba005e555b81144eba8f78e8e5eabee707ea70aff2c422
         | 
    
        data/Gemfile.lock
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            PATH
         | 
| 2 2 | 
             
              remote: .
         | 
| 3 3 | 
             
              specs:
         | 
| 4 | 
            -
                restful_resource (2.12. | 
| 4 | 
            +
                restful_resource (2.12.1)
         | 
| 5 5 | 
             
                  activesupport (~> 6.0)
         | 
| 6 6 | 
             
                  faraday (~> 1.0)
         | 
| 7 7 | 
             
                  faraday-cdn-metrics (~> 0.2)
         | 
| @@ -45,7 +45,7 @@ GEM | |
| 45 45 | 
             
                faraday_middleware (1.0.0)
         | 
| 46 46 | 
             
                  faraday (~> 1.0)
         | 
| 47 47 | 
             
                ffi (1.15.0)
         | 
| 48 | 
            -
                i18n (1.8. | 
| 48 | 
            +
                i18n (1.8.10)
         | 
| 49 49 | 
             
                  concurrent-ruby (~> 1.0)
         | 
| 50 50 | 
             
                link_header (0.0.8)
         | 
| 51 51 | 
             
                method_source (1.0.0)
         | 
    
        data/lib/restful_resource.rb
    CHANGED
    
    | @@ -9,6 +9,7 @@ require 'faraday/encoding' | |
| 9 9 | 
             
            require 'active_support'
         | 
| 10 10 | 
             
            require 'active_support/all'
         | 
| 11 11 | 
             
            require 'resolv-replace'
         | 
| 12 | 
            +
            require_relative 'restful_resource/deprecator'
         | 
| 12 13 | 
             
            require_relative 'restful_resource/version'
         | 
| 13 14 | 
             
            require_relative 'restful_resource/null_logger'
         | 
| 14 15 | 
             
            require_relative 'restful_resource/paginated_array'
         | 
| @@ -0,0 +1,25 @@ | |
| 1 | 
            +
            # frozen_string_literal: true
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            module RestfulResource
         | 
| 4 | 
            +
              class Deprecator < ActiveSupport::Deprecation
         | 
| 5 | 
            +
                GEM_NAME = 'restful_resource'
         | 
| 6 | 
            +
             | 
| 7 | 
            +
                def self.build(horizon: 'soon')
         | 
| 8 | 
            +
                  @deprecators ||= {}
         | 
| 9 | 
            +
                  @deprecators["#{GEM_NAME}@#{horizon}"] ||= new(horizon)
         | 
| 10 | 
            +
                end
         | 
| 11 | 
            +
             | 
| 12 | 
            +
                def initialize(horizon)
         | 
| 13 | 
            +
                  super(horizon, GEM_NAME)
         | 
| 14 | 
            +
             | 
| 15 | 
            +
                  @app_deprecator = ActiveSupport::Deprecation.instance
         | 
| 16 | 
            +
                end
         | 
| 17 | 
            +
             | 
| 18 | 
            +
                # inherit the default configured behavior for the app
         | 
| 19 | 
            +
                delegate :behavior, to: :app_deprecator
         | 
| 20 | 
            +
             | 
| 21 | 
            +
                private
         | 
| 22 | 
            +
             | 
| 23 | 
            +
                attr_reader :app_deprecator
         | 
| 24 | 
            +
              end
         | 
| 25 | 
            +
            end
         | 
| @@ -0,0 +1,21 @@ | |
| 1 | 
            +
            require_relative '../spec_helper'
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            RSpec.describe RestfulResource::StrictOpenStruct do
         | 
| 4 | 
            +
              let(:instance) { described_class.new(foo: 'bar') }
         | 
| 5 | 
            +
             | 
| 6 | 
            +
              describe '#dig' do
         | 
| 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
         | 
| 11 | 
            +
                end
         | 
| 12 | 
            +
              end
         | 
| 13 | 
            +
             | 
| 14 | 
            +
              describe '#[]' do
         | 
| 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
         | 
| 19 | 
            +
                end
         | 
| 20 | 
            +
              end
         | 
| 21 | 
            +
            end
         | 
    
        data/spec/spec_helper.rb
    CHANGED
    
    
    
        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.12. | 
| 4 | 
            +
              version: 2.12.1
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - David Santoro
         | 
| @@ -9,7 +9,7 @@ authors: | |
| 9 9 | 
             
            autorequire:
         | 
| 10 10 | 
             
            bindir: bin
         | 
| 11 11 | 
             
            cert_chain: []
         | 
| 12 | 
            -
            date: 2021- | 
| 12 | 
            +
            date: 2021-04-06 00:00:00.000000000 Z
         | 
| 13 13 | 
             
            dependencies:
         | 
| 14 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 15 | 
             
              name: bundler
         | 
| @@ -260,6 +260,7 @@ files: | |
| 260 260 | 
             
            - lib/restful_resource/associations.rb
         | 
| 261 261 | 
             
            - lib/restful_resource/authorization.rb
         | 
| 262 262 | 
             
            - lib/restful_resource/base.rb
         | 
| 263 | 
            +
            - lib/restful_resource/deprecator.rb
         | 
| 263 264 | 
             
            - lib/restful_resource/http_client.rb
         | 
| 264 265 | 
             
            - lib/restful_resource/instrumentation.rb
         | 
| 265 266 | 
             
            - lib/restful_resource/null_logger.rb
         | 
| @@ -284,6 +285,7 @@ files: | |
| 284 285 | 
             
            - spec/restful_resource/rails_validations_spec.rb
         | 
| 285 286 | 
             
            - spec/restful_resource/redirections_spec.rb
         | 
| 286 287 | 
             
            - spec/restful_resource/request_spec.rb
         | 
| 288 | 
            +
            - spec/restful_resource/strict_open_struct_spec.rb
         | 
| 287 289 | 
             
            - spec/spec_helper.rb
         | 
| 288 290 | 
             
            homepage: http://www.github.com/carwow/restful_resource
         | 
| 289 291 | 
             
            licenses:
         | 
| @@ -304,7 +306,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 304 306 | 
             
                - !ruby/object:Gem::Version
         | 
| 305 307 | 
             
                  version: '0'
         | 
| 306 308 | 
             
            requirements: []
         | 
| 307 | 
            -
            rubygems_version: 3.1. | 
| 309 | 
            +
            rubygems_version: 3.1.2
         | 
| 308 310 | 
             
            signing_key:
         | 
| 309 311 | 
             
            specification_version: 4
         | 
| 310 312 | 
             
            summary: A simple activerecord inspired rest resource base class implemented using
         | 
| @@ -320,4 +322,5 @@ test_files: | |
| 320 322 | 
             
            - spec/restful_resource/rails_validations_spec.rb
         | 
| 321 323 | 
             
            - spec/restful_resource/redirections_spec.rb
         | 
| 322 324 | 
             
            - spec/restful_resource/request_spec.rb
         | 
| 325 | 
            +
            - spec/restful_resource/strict_open_struct_spec.rb
         | 
| 323 326 | 
             
            - spec/spec_helper.rb
         |