retriable 3.8.0 → 5.0.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/.github/workflows/main.yml +38 -9
- data/.hound.yml +1 -1
- data/.rubocop.yml +4 -1
- data/AGENTS.md +15 -0
- data/CHANGELOG.md +159 -0
- data/Gemfile +6 -1
- data/README.md +131 -50
- data/benchmark/config_publication.rb +79 -0
- data/docs/adr/0001-copy-on-write-config-publication.md +124 -0
- data/docs/agents/domain.md +38 -0
- data/docs/agents/issue-tracker.md +45 -0
- data/docs/agents/triage-labels.md +17 -0
- data/docs/migration.md +84 -0
- data/lib/retriable/config.rb +123 -51
- data/lib/retriable/core_ext/kernel.rb +6 -4
- data/lib/retriable/exponential_backoff.rb +13 -5
- data/lib/retriable/validation.rb +11 -7
- data/lib/retriable/version.rb +1 -1
- data/lib/retriable.rb +155 -45
- data/retriable.gemspec +2 -7
- data/sig/retriable.rbs +29 -1
- data/spec/config_spec.rb +212 -97
- data/spec/retriable_spec.rb +666 -104
- data/spec/spec_helper.rb +3 -14
- metadata +14 -53
data/spec/spec_helper.rb
CHANGED
|
@@ -1,27 +1,16 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require "simplecov"
|
|
4
|
-
SimpleCov.start
|
|
4
|
+
SimpleCov.start do
|
|
5
|
+
minimum_coverage 95
|
|
6
|
+
end
|
|
5
7
|
|
|
6
8
|
require "pry"
|
|
7
9
|
require_relative "../lib/retriable"
|
|
8
10
|
require_relative "support/exceptions"
|
|
9
11
|
|
|
10
|
-
# Make Retriable's deprecation notices observable to RSpec's
|
|
11
|
-
# `output().to_stderr` matcher. On Ruby 3.0+ the `:deprecated` warning category
|
|
12
|
-
# is suppressed by default, which would hide the notices we want to assert on.
|
|
13
|
-
WARNING_DEPRECATION_SUPPORTED = defined?(Warning) && Warning.respond_to?(:[])
|
|
14
|
-
Warning[:deprecated] = true if WARNING_DEPRECATION_SUPPORTED
|
|
15
|
-
|
|
16
|
-
# Used by deprecation specs that only make sense on Rubies where `Kernel#warn`
|
|
17
|
-
# supports the `category:` keyword (added in Ruby 2.7).
|
|
18
|
-
WARN_CATEGORY_SUPPORTED = WARNING_DEPRECATION_SUPPORTED &&
|
|
19
|
-
Kernel.method(:warn).parameters.include?(%i[key category])
|
|
20
|
-
|
|
21
12
|
RSpec.configure do |config|
|
|
22
13
|
config.before(:each) do
|
|
23
14
|
srand(0)
|
|
24
|
-
Retriable::Config.timeout_deprecation_warned = false
|
|
25
|
-
Warning[:deprecated] = true if WARNING_DEPRECATION_SUPPORTED
|
|
26
15
|
end
|
|
27
16
|
end
|
metadata
CHANGED
|
@@ -1,56 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: retriable
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 5.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jack Chu
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
10
|
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
-
dependencies:
|
|
12
|
-
- !ruby/object:Gem::Dependency
|
|
13
|
-
name: bundler
|
|
14
|
-
requirement: !ruby/object:Gem::Requirement
|
|
15
|
-
requirements:
|
|
16
|
-
- - ">="
|
|
17
|
-
- !ruby/object:Gem::Version
|
|
18
|
-
version: '0'
|
|
19
|
-
type: :development
|
|
20
|
-
prerelease: false
|
|
21
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
-
requirements:
|
|
23
|
-
- - ">="
|
|
24
|
-
- !ruby/object:Gem::Version
|
|
25
|
-
version: '0'
|
|
26
|
-
- !ruby/object:Gem::Dependency
|
|
27
|
-
name: rspec
|
|
28
|
-
requirement: !ruby/object:Gem::Requirement
|
|
29
|
-
requirements:
|
|
30
|
-
- - "~>"
|
|
31
|
-
- !ruby/object:Gem::Version
|
|
32
|
-
version: '3'
|
|
33
|
-
type: :development
|
|
34
|
-
prerelease: false
|
|
35
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
36
|
-
requirements:
|
|
37
|
-
- - "~>"
|
|
38
|
-
- !ruby/object:Gem::Version
|
|
39
|
-
version: '3'
|
|
40
|
-
- !ruby/object:Gem::Dependency
|
|
41
|
-
name: listen
|
|
42
|
-
requirement: !ruby/object:Gem::Requirement
|
|
43
|
-
requirements:
|
|
44
|
-
- - "~>"
|
|
45
|
-
- !ruby/object:Gem::Version
|
|
46
|
-
version: '3.1'
|
|
47
|
-
type: :development
|
|
48
|
-
prerelease: false
|
|
49
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
50
|
-
requirements:
|
|
51
|
-
- - "~>"
|
|
52
|
-
- !ruby/object:Gem::Version
|
|
53
|
-
version: '3.1'
|
|
11
|
+
dependencies: []
|
|
54
12
|
description: Retriable is a simple DSL to retry failed code blocks with randomized
|
|
55
13
|
exponential backoff. This is especially useful when interacting with external APIs/services
|
|
56
14
|
or file system calls.
|
|
@@ -66,14 +24,21 @@ files:
|
|
|
66
24
|
- ".hound.yml"
|
|
67
25
|
- ".rspec"
|
|
68
26
|
- ".rubocop.yml"
|
|
27
|
+
- AGENTS.md
|
|
69
28
|
- CHANGELOG.md
|
|
70
29
|
- CODE_OF_CONDUCT.md
|
|
71
30
|
- Gemfile
|
|
72
31
|
- LICENSE
|
|
73
32
|
- README.md
|
|
74
33
|
- Rakefile
|
|
34
|
+
- benchmark/config_publication.rb
|
|
75
35
|
- bin/console
|
|
76
36
|
- bin/setup
|
|
37
|
+
- docs/adr/0001-copy-on-write-config-publication.md
|
|
38
|
+
- docs/agents/domain.md
|
|
39
|
+
- docs/agents/issue-tracker.md
|
|
40
|
+
- docs/agents/triage-labels.md
|
|
41
|
+
- docs/migration.md
|
|
77
42
|
- docs/testing.md
|
|
78
43
|
- lib/retriable.rb
|
|
79
44
|
- lib/retriable/config.rb
|
|
@@ -91,7 +56,8 @@ files:
|
|
|
91
56
|
homepage: https://github.com/kamui/retriable
|
|
92
57
|
licenses:
|
|
93
58
|
- MIT
|
|
94
|
-
metadata:
|
|
59
|
+
metadata:
|
|
60
|
+
rubygems_mfa_required: 'true'
|
|
95
61
|
rdoc_options: []
|
|
96
62
|
require_paths:
|
|
97
63
|
- lib
|
|
@@ -99,20 +65,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
99
65
|
requirements:
|
|
100
66
|
- - ">="
|
|
101
67
|
- !ruby/object:Gem::Version
|
|
102
|
-
version:
|
|
68
|
+
version: '3.2'
|
|
103
69
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
104
70
|
requirements:
|
|
105
71
|
- - ">="
|
|
106
72
|
- !ruby/object:Gem::Version
|
|
107
73
|
version: '0'
|
|
108
74
|
requirements: []
|
|
109
|
-
rubygems_version: 4.0.
|
|
75
|
+
rubygems_version: 4.0.16
|
|
110
76
|
specification_version: 4
|
|
111
77
|
summary: Retriable is a simple DSL to retry failed code blocks with randomized exponential
|
|
112
78
|
backoff
|
|
113
|
-
test_files:
|
|
114
|
-
- spec/config_spec.rb
|
|
115
|
-
- spec/exponential_backoff_spec.rb
|
|
116
|
-
- spec/retriable_spec.rb
|
|
117
|
-
- spec/spec_helper.rb
|
|
118
|
-
- spec/support/exceptions.rb
|
|
79
|
+
test_files: []
|