bullet_proof_json 0.2.0 → 0.2.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/ruby.yml +7 -0
- data/.gitignore +3 -0
- data/CHANGELOG.md +8 -0
- data/Gemfile.lock +9 -1
- data/README.md +17 -0
- data/bullet_proof_json.gemspec +4 -0
- data/lib/bullet_proof_json/provider.rb +3 -3
- data/lib/bullet_proof_json/version.rb +1 -1
- data/lib/bullet_proof_json.rb +1 -1
- metadata +18 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34ddf20fa884b08de58f2b6345d6a95f15f3eca92349b29377219cc2323691d6
|
4
|
+
data.tar.gz: 9435f6aa2cf52335ab5154280c397bad0593f0e81e3d5cd1f970d32269018769
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33534e8d747a100b7f6e657a2eccfc74e002736d6b4863207fa18378ad01ffbc7675a6b5bdffc95c4b4ee1df2b37e24a32e85dd041988db78599076d981b7d17
|
7
|
+
data.tar.gz: eff4ea4dc8d24e85651146ae46eb65a7c6882413fa12ce479447bd725eced5141ff85605295369cc3b17eae9164e82a032286cac6c13d8a8f5f9ce697c5225ca
|
data/.github/workflows/ruby.yml
CHANGED
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
## [0.2.1] - 2025-07-22
|
2
|
+
### Added
|
3
|
+
- How to release a new version in README
|
4
|
+
- Full test coverage
|
5
|
+
- Upload test coverage to codecov.io using codecov/codecov-action@v5 GitHub action
|
6
|
+
### Fixed
|
7
|
+
- max_retries condition
|
8
|
+
|
1
9
|
## [0.2.0] - 2025-07-22
|
2
10
|
### Added
|
3
11
|
- HTTP request header User-Agent with a gem name to be identified properly by public APIs
|
data/Gemfile.lock
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
bullet_proof_json (0.2.
|
4
|
+
bullet_proof_json (0.2.1)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
9
|
coderay (1.1.3)
|
10
10
|
diff-lcs (1.6.2)
|
11
|
+
docile (1.4.1)
|
11
12
|
ffi (1.17.2)
|
12
13
|
formatador (1.1.1)
|
13
14
|
guard (2.19.1)
|
@@ -58,6 +59,12 @@ GEM
|
|
58
59
|
rspec-support (~> 3.13.0)
|
59
60
|
rspec-support (3.13.4)
|
60
61
|
shellany (0.0.1)
|
62
|
+
simplecov (0.22.0)
|
63
|
+
docile (~> 1.1)
|
64
|
+
simplecov-html (~> 0.11)
|
65
|
+
simplecov_json_formatter (~> 0.1)
|
66
|
+
simplecov-html (0.13.2)
|
67
|
+
simplecov_json_formatter (0.1.4)
|
61
68
|
thor (1.4.0)
|
62
69
|
|
63
70
|
PLATFORMS
|
@@ -71,6 +78,7 @@ DEPENDENCIES
|
|
71
78
|
pry (~> 0.15.2)
|
72
79
|
rake (~> 12.3)
|
73
80
|
rspec (~> 3.0)
|
81
|
+
simplecov (~> 0.22.0)
|
74
82
|
|
75
83
|
BUNDLED WITH
|
76
84
|
2.6.3
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
[](https://github.com/grzegorzblaszczyk/bullet-proof-json/actions/workflows/ruby.yml)
|
2
2
|
[](https://github.com/grzegorzblaszczyk/bullet-proof-json/actions/workflows/dependabot/dependabot-updates)
|
3
|
+
[](https://badge.fury.io/rb/bullet-proof-json)
|
4
|
+
[](https://codecov.io/gh/grzegorzblaszczyk/bullet-proof-json)
|
3
5
|
|
4
6
|
# The Goal
|
5
7
|
|
@@ -20,6 +22,8 @@ It depends only on a few standard Ruby libraries like:
|
|
20
22
|
* JSON
|
21
23
|
* Net::HTTP
|
22
24
|
|
25
|
+
🪶 No dependencies except standard Ruby classes.
|
26
|
+
|
23
27
|
# Installation
|
24
28
|
|
25
29
|
Add this line to your application's Gemfile:
|
@@ -74,3 +78,16 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
74
78
|
|
75
79
|
Everyone interacting in the BulletProofJSON project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/grzegorzblaszczyk/bullet-proof-json-provider//blob/master/CODE_OF_CONDUCT.md).
|
76
80
|
|
81
|
+
## How to release a new version to RubyGems.org
|
82
|
+
|
83
|
+
```bash
|
84
|
+
rspec spec
|
85
|
+
mdv CHANGELOG.md
|
86
|
+
git ci -m "UPGRADE: version x.y.z" .
|
87
|
+
git push origin main
|
88
|
+
gem build bullet_proof_json.gemspec
|
89
|
+
gem push bullet_proof_json-x.y.z.gem
|
90
|
+
git tag vx.y.z
|
91
|
+
git push origin main --tags
|
92
|
+
```
|
93
|
+
|
data/bullet_proof_json.gemspec
CHANGED
@@ -9,6 +9,9 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["Grzegorz Błaszczyk"]
|
10
10
|
spec.email = ["grzegorz.blaszczyk@gmail.com"]
|
11
11
|
|
12
|
+
spec.metadata["source_code_uri"] = "https://github.com/grzegorzblaszczyk/bullet-proof-json"
|
13
|
+
spec.metadata["changelog_uri"] = "https://github.com/grzegorzblaszczyk/bullet-proof-json/blob/main/CHANGELOG.md"
|
14
|
+
|
12
15
|
spec.summary = "Bullet Proof JSON for Ruby with seamless request handling, smart throttling and robust retry mchanism"
|
13
16
|
spec.description = "Bullet Proof JSON for Ruby takes the hassle out of API response handling by offering: Seamless Request Handling - automatically manage timeouts and errors so your app stays resilient, Smart Throttling - respect API rate limits without overcomplicating your code, Robust Retry Mechanism - never miss a response due to transient errors."
|
14
17
|
spec.homepage = "https://github.com/grzegorzblaszczyk/bullet-proof-json"
|
@@ -31,4 +34,5 @@ Gem::Specification.new do |spec|
|
|
31
34
|
spec.add_development_dependency "pry", "~> 0.15.2"
|
32
35
|
spec.add_development_dependency "rake", "~> 12.3"
|
33
36
|
spec.add_development_dependency "rspec", "~> 3.0"
|
37
|
+
spec.add_development_dependency "simplecov", "~> 0.22.0"
|
34
38
|
end
|
@@ -29,7 +29,7 @@ module BulletProofJson
|
|
29
29
|
|
30
30
|
rescue ::Net::ReadTimeout => e
|
31
31
|
@logger.error(self.class.name, " #{page.nil? ? "" : (page.to_s + ":")} #{e}\n#{uri_string}")
|
32
|
-
if (attempts += 1)
|
32
|
+
if (attempts += 1) <= max_attempts
|
33
33
|
@logger.debug(self.class.name, "\tAttempt no. #{attempts} ...")
|
34
34
|
sleep sleep_time
|
35
35
|
retry
|
@@ -40,7 +40,7 @@ module BulletProofJson
|
|
40
40
|
|
41
41
|
rescue ::Net::OpenTimeout => e
|
42
42
|
@logger.error(self.class.name, " #{page.nil? ? "" : (page.to_s + ":")} #{e}\n#{uri_string}")
|
43
|
-
if (attempts += 1)
|
43
|
+
if (attempts += 1) <= max_attempts
|
44
44
|
@logger.debug(self.class.name, "\tAttempt no. #{attempts} ...")
|
45
45
|
sleep sleep_time
|
46
46
|
retry
|
@@ -52,7 +52,7 @@ module BulletProofJson
|
|
52
52
|
rescue ::JSON::ParserError => e
|
53
53
|
@logger.error(self.class.name, " #{page.nil? ? "" : (page.to_s + ":")} #{e}\n#{uri_string}")
|
54
54
|
|
55
|
-
if (attempts += 1)
|
55
|
+
if (attempts += 1) <= max_attempts
|
56
56
|
@logger.debug(self.class.name, "\tAttempt no. #{attempts} ...")
|
57
57
|
sleep sleep_time
|
58
58
|
retry
|
data/lib/bullet_proof_json.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bullet_proof_json
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Grzegorz Błaszczyk
|
@@ -93,6 +93,20 @@ dependencies:
|
|
93
93
|
- - "~>"
|
94
94
|
- !ruby/object:Gem::Version
|
95
95
|
version: '3.0'
|
96
|
+
- !ruby/object:Gem::Dependency
|
97
|
+
name: simplecov
|
98
|
+
requirement: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - "~>"
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: 0.22.0
|
103
|
+
type: :development
|
104
|
+
prerelease: false
|
105
|
+
version_requirements: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - "~>"
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 0.22.0
|
96
110
|
description: 'Bullet Proof JSON for Ruby takes the hassle out of API response handling
|
97
111
|
by offering: Seamless Request Handling - automatically manage timeouts and errors
|
98
112
|
so your app stays resilient, Smart Throttling - respect API rate limits without
|
@@ -127,7 +141,9 @@ files:
|
|
127
141
|
homepage: https://github.com/grzegorzblaszczyk/bullet-proof-json
|
128
142
|
licenses:
|
129
143
|
- MIT
|
130
|
-
metadata:
|
144
|
+
metadata:
|
145
|
+
source_code_uri: https://github.com/grzegorzblaszczyk/bullet-proof-json
|
146
|
+
changelog_uri: https://github.com/grzegorzblaszczyk/bullet-proof-json/blob/main/CHANGELOG.md
|
131
147
|
rdoc_options: []
|
132
148
|
require_paths:
|
133
149
|
- lib
|