zerobounce-sdk 2.1.4 → 2.1.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b617667aabee47a92fde32c4b4d12eaa132d25c6873e42930425376b0e1b00d3
4
- data.tar.gz: 372e8da40e33f992a5c37c6af94cdbaefa60376e4e576b193d532846c8f82510
3
+ metadata.gz: c86ddf9ad6c2ad0ccb3795dae6f7e8a9e11754ab8ce56de593c05d98be5e91a3
4
+ data.tar.gz: 5c5efe684358aa3975ad4773d4aa70cf180877672fa794406e4d9e89d46d5d77
5
5
  SHA512:
6
- metadata.gz: 281f8049a31c3ce3291a5a1ac4b093002918d1c403092e9716b958223b13498b9c0a8c37e2a5e46245a8891c11a8da3198ee56ced5a2abff402fd12193dbee5b
7
- data.tar.gz: c4847c780bd16ba9918963f94ba5df4f7489de9a51bef6cc01c634f88ea598964cd60fdcae42773766a2418b84931074785858b7763dfd8bbe5a9cad4a866bd2
6
+ metadata.gz: b29b4c25e9954827fe407cee461712750068df4cf91fc8861029b60348f44fb95518c37a7041f8dea45b9578c965cd71ffc4d800fcf480c491e03d5a71d45dbe
7
+ data.tar.gz: 788a1c8c0c21ecfb3a15d0ee19295054866a65deee7f4242be211136537ac04540b92b4af01d924141e8ace913fc9c80d575b4295d4fe39d29335ccc37b52f52
@@ -71,7 +71,7 @@ jobs:
71
71
 
72
72
  # Initializes the CodeQL tools for scanning.
73
73
  - name: Initialize CodeQL
74
- uses: github/codeql-action/init@v4.35.2
74
+ uses: github/codeql-action/init@v4.36.2
75
75
  with:
76
76
  languages: ${{ matrix.language }}
77
77
  build-mode: ${{ matrix.build-mode }}
@@ -100,6 +100,6 @@ jobs:
100
100
  exit 1
101
101
 
102
102
  - name: Perform CodeQL Analysis
103
- uses: github/codeql-action/analyze@v4.35.2
103
+ uses: github/codeql-action/analyze@v4.36.2
104
104
  with:
105
105
  category: "/language:${{matrix.language}}"
@@ -0,0 +1,131 @@
1
+ name: Publish
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ tag:
7
+ type: string
8
+ description: Tag to publish (e.g. v2.1.5)
9
+ required: true
10
+
11
+ permissions:
12
+ contents: read
13
+
14
+ jobs:
15
+ validate-tag:
16
+ name: Validate tag
17
+ runs-on: ubuntu-latest
18
+ steps:
19
+ - name: Checkout
20
+ uses: actions/checkout@v6
21
+ with:
22
+ fetch-depth: 0
23
+ ref: ${{ github.event.inputs.tag }}
24
+
25
+ - name: Verify tag and gem version
26
+ run: |
27
+ TAG="${{ github.event.inputs.tag }}"
28
+ if [ -z "$TAG" ]; then
29
+ echo "Error: Tag is required."
30
+ exit 1
31
+ fi
32
+ if ! git rev-parse "$TAG" >/dev/null 2>&1; then
33
+ echo "Error: Tag '$TAG' does not exist."
34
+ exit 1
35
+ fi
36
+ TAG_VERSION="${TAG#v}"
37
+ PKG_VERSION=$(grep -E "VERSION\s*=" lib/zerobounce/version.rb | sed -E "s/.*'([^']+)'.*/\1/")
38
+ if [ -z "$PKG_VERSION" ]; then
39
+ echo "Error: Could not read version from lib/zerobounce/version.rb"
40
+ exit 1
41
+ fi
42
+ if [ "$PKG_VERSION" != "$TAG_VERSION" ]; then
43
+ echo "Error: lib/zerobounce/version.rb ($PKG_VERSION) does not match tag ($TAG)."
44
+ exit 1
45
+ fi
46
+ echo "Publishing tag: $TAG (zerobounce-sdk@$PKG_VERSION)"
47
+
48
+ test:
49
+ name: Test
50
+ needs: [validate-tag]
51
+ if: ${{ !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') }}
52
+ runs-on: ubuntu-latest
53
+ env:
54
+ ZEROBOUNCE_API_KEY: "invalid_key_for_tests"
55
+ steps:
56
+ - name: Checkout tag
57
+ uses: actions/checkout@v6
58
+ with:
59
+ ref: ${{ github.event.inputs.tag }}
60
+
61
+ - name: Set up Ruby
62
+ uses: ruby/setup-ruby@v1
63
+ with:
64
+ ruby-version: "3.2"
65
+ bundler-cache: true
66
+
67
+ - name: Run specs
68
+ run: bundle exec rspec
69
+
70
+ publish:
71
+ name: Build and publish to RubyGems
72
+ needs: [test]
73
+ if: ${{ !cancelled() && !failure() }}
74
+ runs-on: ubuntu-latest
75
+ environment: release
76
+ permissions:
77
+ id-token: write
78
+ contents: read
79
+ steps:
80
+ - name: Checkout tag
81
+ uses: actions/checkout@v6
82
+ with:
83
+ ref: ${{ github.event.inputs.tag }}
84
+
85
+ - name: Set up Ruby
86
+ uses: ruby/setup-ruby@v1
87
+ with:
88
+ ruby-version: "3.2"
89
+ bundler-cache: true
90
+
91
+ - name: Configure RubyGems credentials
92
+ uses: rubygems/configure-rubygems-credentials@main
93
+ with:
94
+ api-token: ${{ secrets.RUBYGEMS_API_TOKEN }}
95
+
96
+ - name: Build gem
97
+ run: gem build zerobounce.gemspec
98
+
99
+ - name: Publish to RubyGems
100
+ run: |
101
+ GEM_FILE=$(ls zerobounce-sdk-*.gem)
102
+ echo "Pushing $GEM_FILE"
103
+ gem push "$GEM_FILE"
104
+
105
+ release:
106
+ name: Create GitHub Release
107
+ needs: [publish]
108
+ if: ${{ !cancelled() && !failure() }}
109
+ runs-on: ubuntu-latest
110
+ permissions:
111
+ contents: write
112
+ steps:
113
+ - name: Checkout
114
+ uses: actions/checkout@v6
115
+ with:
116
+ ref: ${{ github.event.inputs.tag }}
117
+ fetch-depth: 0
118
+
119
+ - name: Create release if missing
120
+ env:
121
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
122
+ run: |
123
+ TAG="${{ github.event.inputs.tag }}"
124
+ if gh release view "$TAG" --repo "${{ github.repository }}" >/dev/null 2>&1; then
125
+ echo "Release $TAG already exists, skipping."
126
+ else
127
+ gh release create "$TAG" \
128
+ --repo "${{ github.repository }}" \
129
+ --title "$TAG" \
130
+ --generate-notes
131
+ fi
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ # 2.1.7
2
+
3
+ * Update Gemfile.lock for v2.1.6 release.
4
+
5
+ # 2.1.6
6
+
7
+ * Route `validatebatch` requests to `api.zerobounce.net` instead of `bulkapi.zerobounce.net`.
8
+
1
9
  # 2.1.1
2
10
 
3
11
  * Raise development and transitive dependency floors to address security advisories for REXML, Addressable, and YARD (updated `Gemfile.lock`; see `Gemfile` and `zerobounce.gemspec`).
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- zerobounce-sdk (2.1.4)
4
+ zerobounce-sdk (2.1.7)
5
5
  dotenv
6
6
  rest-client (~> 2.1)
7
7
 
data/README.md CHANGED
@@ -727,9 +727,10 @@ bundle install
727
727
  ```
728
728
 
729
729
  ### Run tests with Docker
730
- From the **parent repository root** (the folder that contains all SDKs and `docker-compose.yml`):
730
+ From the **`sdk-docs/`** folder in the SDKs monorepo:
731
731
 
732
732
  ```bash
733
+ cd sdk-docs
733
734
  docker compose build ruby
734
735
  docker compose run --rm ruby
735
736
  ```
@@ -772,4 +773,7 @@ Tests use webmock and vcr for mocking HTTP requests. This means that actual requ
772
773
 
773
774
  ## Publish
774
775
 
775
- See the [sdk-docs (RubyGems)](../sdk-docs/rubygems/) guide in the SDKs repo for build and `gem push` steps.
776
+ 1. Bump `VERSION` in `lib/zerobounce/version.rb`, commit, tag (`vX.Y.Z`), push tag.
777
+ 2. **Actions → Publish → Run workflow** with that tag.
778
+
779
+ Registry: [zerobounce-sdk on RubyGems](https://rubygems.org/gems/zerobounce-sdk)
@@ -47,6 +47,23 @@ module Zerobounce
47
47
  GetFileHelper.process_getfile_response(response)
48
48
  end
49
49
 
50
+ def self.post(path, params, content_type='application/json', filepath=nil)
51
+ response = self._post(Zerobounce.configuration.api_root_url, path, params, \
52
+ content_type, filepath)
53
+ if response.headers[:content_type] == 'application/json'
54
+ response_body = response.body
55
+ response_body_json = JSON.parse(response_body)
56
+
57
+ raise (response_body_json['error']) if response_body_json.key?('error')
58
+ raise (response_body_json['errors'][0]['error']) \
59
+ if response_body_json.key?('errors') and \
60
+ response_body_json['errors'].length > 0
61
+
62
+ return response_body_json
63
+ end
64
+ return response.body
65
+ end
66
+
50
67
  def self.bulk_post(path, params, content_type='application/json', filepath=nil)
51
68
  response = self._post(Zerobounce.configuration.bulk_api_root_url, path, params, \
52
69
  content_type, filepath)
@@ -54,6 +54,23 @@ module Zerobounce
54
54
  GetFileHelper.process_getfile_response(response)
55
55
  end
56
56
 
57
+ def self.post(path, params, content_type='application/json', filepath=nil)
58
+ response = self._post(Zerobounce.configuration.api_root_url, path, params, \
59
+ content_type, filepath)
60
+ if response.headers[:content_type] == 'application/json'
61
+ response_body = response.body
62
+ response_body_json = JSON.parse(response_body)
63
+
64
+ raise (response_body_json['error']) if response_body_json.key?('error')
65
+ raise (response_body_json['errors'][0]['error']) \
66
+ if response_body_json.key?('errors') and \
67
+ response_body_json['errors'].length > 0
68
+
69
+ return response_body_json
70
+ end
71
+ return response.body
72
+ end
73
+
57
74
  def self.bulk_post(path, params, content_type='application/json', filepath=nil)
58
75
  response = self._post(Zerobounce.configuration.bulk_api_root_url, path, params, \
59
76
  content_type, filepath)
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Zerobounce
4
4
  # The version of the gem.
5
- VERSION = '2.1.4'
5
+ VERSION = '2.1.7'
6
6
  end
data/lib/zerobounce.rb CHANGED
@@ -68,6 +68,7 @@ module Zerobounce
68
68
  # "domain": null,
69
69
  # "domain_age_days": "9692",
70
70
  # "smtp_provider": "example",
71
+ # "catchall_domain": false,
71
72
  # "mx_found": "true",
72
73
  # "mx_record": "mx.example.com",
73
74
  # "firstname": "zero",
@@ -199,6 +200,7 @@ module Zerobounce
199
200
  # "domain": null,
200
201
  # "domain_age_days": "9692",
201
202
  # "smtp_provider": "example",
203
+ # "catchall_domain": false,
202
204
  # "mx_found": "true",
203
205
  # "mx_record": "mx.example.com",
204
206
  # "firstname": "zero",
@@ -230,7 +232,7 @@ module Zerobounce
230
232
  })
231
233
  end
232
234
  params = {email_batch: email_batch}
233
- results = @@request.bulk_post('validatebatch', params)
235
+ results = @@request.post('validatebatch', params)
234
236
  return results['email_batch']
235
237
  end
236
238
 
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zerobounce-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.4
4
+ version: 2.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zero Bounce
8
+ autorequire:
8
9
  bindir: exe
9
10
  cert_chain: []
10
- date: 1980-01-02 00:00:00.000000000 Z
11
+ date: 2026-06-17 00:00:00.000000000 Z
11
12
  dependencies:
12
13
  - !ruby/object:Gem::Dependency
13
14
  name: rest-client
@@ -294,6 +295,7 @@ files:
294
295
  - ".github/dependabot.yml"
295
296
  - ".github/workflows/auto_assign_ci.yaml"
296
297
  - ".github/workflows/codeql.yml"
298
+ - ".github/workflows/publish.yml"
297
299
  - ".github/workflows/sdk_ci.yml"
298
300
  - ".gitignore"
299
301
  - ".rspec"
@@ -338,6 +340,7 @@ licenses:
338
340
  - MIT
339
341
  metadata:
340
342
  yard.run: yri
343
+ post_install_message:
341
344
  rdoc_options: []
342
345
  require_paths:
343
346
  - lib
@@ -352,7 +355,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
352
355
  - !ruby/object:Gem::Version
353
356
  version: '0'
354
357
  requirements: []
355
- rubygems_version: 4.0.8
358
+ rubygems_version: 3.4.19
359
+ signing_key:
356
360
  specification_version: 4
357
361
  summary: A Ruby client for Zerobounce.net.
358
362
  test_files: []