recoverable 0.0.5 → 0.0.6
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/lib/recoverable.rb +0 -4
 - data/lib/recoverable/base.rb +3 -3
 - data/lib/recoverable/errors.rb +1 -5
 - data/lib/recoverable/version.rb +1 -1
 - data/spec/mocks/test_errors.rb +3 -3
 - data/spec/recoverable_spec.rb +2 -1
 - data/spec/spec_helper.rb +1 -7
 - metadata +1 -29
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: e3cd84a75cc65ec1edb7af123525092ef9f0194a
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: def900fb2218f4dd57e45f7f7abc1b8ced7ceffe
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 51bea1cac9ba766e6739541e6a5b83a77787a38c7315c100ee1f9ea421c851ac476d9bb97e4b6e5626314c1bfde5c8ebf28467f9ed9a47531cd78cfdff550ec2
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 2b86282e90d387b9655d7ae312295b82a6ff92790d15eab23cef8b99bc8ed2c297683918b1b33e663897ad305f23e589d7015e921c35ffd41bffa4f2c170cbe0
         
     | 
    
        data/lib/recoverable.rb
    CHANGED
    
    
    
        data/lib/recoverable/base.rb
    CHANGED
    
    | 
         @@ -1,6 +1,6 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            module Recoverable
         
     | 
| 
       2 
2 
     | 
    
         
             
              def recover(method_name, tries: 1, on: StandardError, wait: nil, wait_method: nil,custom_handler: nil, throw: RetryCountExceeded)
         
     | 
| 
       3 
     | 
    
         
            -
                recoverable =  
     | 
| 
      
 3 
     | 
    
         
            +
                recoverable = [on].flatten
         
     | 
| 
       4 
4 
     | 
    
         
             
                proxy       = create_proxy(method_name: method_name, tries: tries, recoverable: recoverable, wait: wait, wait_method: wait_method, custom_handler: custom_handler, throw: throw)
         
     | 
| 
       5 
5 
     | 
    
         
             
                self.prepend proxy
         
     | 
| 
       6 
6 
     | 
    
         
             
              end
         
     | 
| 
         @@ -60,7 +60,7 @@ module Recoverable 
     | 
|
| 
       60 
60 
     | 
    
         
             
              end
         
     | 
| 
       61 
61 
     | 
    
         | 
| 
       62 
62 
     | 
    
         
             
              def fetch_instance_variables(instance)
         
     | 
| 
       63 
     | 
    
         
            -
                 
     | 
| 
      
 63 
     | 
    
         
            +
                instance_variables.map { |name| name[1..-1].to_sym }
         
     | 
| 
       64 
64 
     | 
    
         
             
              end
         
     | 
| 
       65 
65 
     | 
    
         | 
| 
       66 
66 
     | 
    
         
             
              def fetch_local_args(args)
         
     | 
| 
         @@ -72,7 +72,7 @@ module Recoverable 
     | 
|
| 
       72 
72 
     | 
    
         
             
                instance.send(:public_methods) +
         
     | 
| 
       73 
73 
     | 
    
         
             
                instance.send(:local_variables)
         
     | 
| 
       74 
74 
     | 
    
         
             
              end
         
     | 
| 
       75 
     | 
    
         
            -
             
     | 
| 
      
 75 
     | 
    
         
            +
             
     | 
| 
       76 
76 
     | 
    
         
             
            end
         
     | 
| 
       77 
77 
     | 
    
         | 
| 
       78 
78 
     | 
    
         | 
    
        data/lib/recoverable/errors.rb
    CHANGED
    
    
    
        data/lib/recoverable/version.rb
    CHANGED
    
    
    
        data/spec/mocks/test_errors.rb
    CHANGED
    
    | 
         @@ -1,3 +1,3 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
             
     | 
| 
       2 
     | 
    
         
            -
             
     | 
| 
       3 
     | 
    
         
            -
             
     | 
| 
      
 1 
     | 
    
         
            +
            CustomError = Class.new(StandardError)
         
     | 
| 
      
 2 
     | 
    
         
            +
            UnrecoveredError = Class.new(StandardError)
         
     | 
| 
      
 3 
     | 
    
         
            +
            AlternateCustomError = Class.new(StandardError)
         
     | 
    
        data/spec/recoverable_spec.rb
    CHANGED
    
    
    
        data/spec/spec_helper.rb
    CHANGED
    
    | 
         @@ -8,7 +8,6 @@ end 
     | 
|
| 
       8 
8 
     | 
    
         | 
| 
       9 
9 
     | 
    
         
             
            require 'recoverable'
         
     | 
| 
       10 
10 
     | 
    
         
             
            require 'mocks/test_errors'
         
     | 
| 
       11 
     | 
    
         
            -
            require 'factory_bot'
         
     | 
| 
       12 
11 
     | 
    
         | 
| 
       13 
12 
     | 
    
         
             
            RSpec.configure do |config|
         
     | 
| 
       14 
13 
     | 
    
         
             
              # Enable flags like --only-failures and --next-failure
         
     | 
| 
         @@ -20,12 +19,7 @@ RSpec.configure do |config| 
     | 
|
| 
       20 
19 
     | 
    
         
             
              config.expect_with :rspec do |c|
         
     | 
| 
       21 
20 
     | 
    
         
             
                c.syntax = :expect
         
     | 
| 
       22 
21 
     | 
    
         
             
              end
         
     | 
| 
       23 
     | 
    
         
            -
              config.include FactoryBot::Syntax::Methods
         
     | 
| 
       24 
     | 
    
         
            -
             
     | 
| 
       25 
     | 
    
         
            -
              config.before(:suite) do
         
     | 
| 
       26 
     | 
    
         
            -
                FactoryBot.find_definitions
         
     | 
| 
       27 
     | 
    
         
            -
              end
         
     | 
| 
       28 
22 
     | 
    
         | 
| 
       29 
23 
     | 
    
         
             
            end
         
     | 
| 
       30 
24 
     | 
    
         | 
| 
       31 
     | 
    
         
            -
            RSpec::Expectations.configuration.on_potential_false_positives = :nothing
         
     | 
| 
      
 25 
     | 
    
         
            +
            RSpec::Expectations.configuration.on_potential_false_positives = :nothing
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: recoverable
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.0.6
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Ben Jacobs
         
     | 
| 
         @@ -10,20 +10,6 @@ bindir: bin 
     | 
|
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
11 
     | 
    
         
             
            date: 2018-11-15 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
     | 
    
         
            -
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
     | 
    
         
            -
              name: activesupport
         
     | 
| 
       15 
     | 
    
         
            -
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       16 
     | 
    
         
            -
                requirements:
         
     | 
| 
       17 
     | 
    
         
            -
                - - ">="
         
     | 
| 
       18 
     | 
    
         
            -
                  - !ruby/object:Gem::Version
         
     | 
| 
       19 
     | 
    
         
            -
                    version: '0'
         
     | 
| 
       20 
     | 
    
         
            -
              type: :runtime
         
     | 
| 
       21 
     | 
    
         
            -
              prerelease: false
         
     | 
| 
       22 
     | 
    
         
            -
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       23 
     | 
    
         
            -
                requirements:
         
     | 
| 
       24 
     | 
    
         
            -
                - - ">="
         
     | 
| 
       25 
     | 
    
         
            -
                  - !ruby/object:Gem::Version
         
     | 
| 
       26 
     | 
    
         
            -
                    version: '0'
         
     | 
| 
       27 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       28 
14 
     | 
    
         
             
              name: pry-byebug
         
     | 
| 
       29 
15 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
         @@ -80,20 +66,6 @@ dependencies: 
     | 
|
| 
       80 
66 
     | 
    
         
             
                - - "~>"
         
     | 
| 
       81 
67 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       82 
68 
     | 
    
         
             
                    version: '3.0'
         
     | 
| 
       83 
     | 
    
         
            -
            - !ruby/object:Gem::Dependency
         
     | 
| 
       84 
     | 
    
         
            -
              name: factory_bot
         
     | 
| 
       85 
     | 
    
         
            -
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       86 
     | 
    
         
            -
                requirements:
         
     | 
| 
       87 
     | 
    
         
            -
                - - "~>"
         
     | 
| 
       88 
     | 
    
         
            -
                  - !ruby/object:Gem::Version
         
     | 
| 
       89 
     | 
    
         
            -
                    version: '4.0'
         
     | 
| 
       90 
     | 
    
         
            -
              type: :development
         
     | 
| 
       91 
     | 
    
         
            -
              prerelease: false
         
     | 
| 
       92 
     | 
    
         
            -
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       93 
     | 
    
         
            -
                requirements:
         
     | 
| 
       94 
     | 
    
         
            -
                - - "~>"
         
     | 
| 
       95 
     | 
    
         
            -
                  - !ruby/object:Gem::Version
         
     | 
| 
       96 
     | 
    
         
            -
                    version: '4.0'
         
     | 
| 
       97 
69 
     | 
    
         
             
            description: Class Level retry DSL for ruby
         
     | 
| 
       98 
70 
     | 
    
         
             
            email:
         
     | 
| 
       99 
71 
     | 
    
         
             
            - benjaminpjacobs@gmail.com
         
     |