zerobounce-sdk 1.1.1 → 2.1.8
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/.dockerignore +17 -0
- data/.env.example +3 -0
- data/.github/auto_assign.yml +5 -0
- data/.github/dependabot.yml +35 -0
- data/.github/workflows/auto_assign_ci.yaml +21 -0
- data/.github/workflows/codeql.yml +105 -0
- data/.github/workflows/publish.yml +131 -0
- data/.github/workflows/sdk_ci.yml +29 -0
- data/.gitignore +6 -0
- data/CHANGELOG.md +12 -0
- data/CODE_OF_CONDUCT.md +1 -6
- data/CONTRIBUTING.md +112 -1
- data/Dockerfile +17 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +24 -12
- data/LICENSE +1 -1
- data/LICENSE.txt +6 -6
- data/README.md +313 -24
- data/SECURITY.md +21 -0
- data/documentation.md +104 -11
- data/lib/zerobounce/api_urls.rb +18 -0
- data/lib/zerobounce/base_request.rb +31 -3
- data/lib/zerobounce/configuration.rb +13 -9
- data/lib/zerobounce/download_type.rb +10 -0
- data/lib/zerobounce/get_file_helper.rb +90 -0
- data/lib/zerobounce/get_file_options.rb +14 -0
- data/lib/zerobounce/mock_request.rb +26 -3
- data/lib/zerobounce/request.rb +27 -3
- data/lib/zerobounce/validate_status.rb +17 -0
- data/lib/zerobounce/validate_sub_status.rb +40 -0
- data/lib/zerobounce/version.rb +1 -1
- data/lib/zerobounce.rb +203 -30
- data/zerobounce.gemspec +7 -3
- metadata +86 -16
- data/.env.sample +0 -3
- data/documentation_es.md +0 -449
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e9f3c2a7bac4386a95e440f91b2c05fd70a9ed4fba0676aba089bb654b6c0a78
|
|
4
|
+
data.tar.gz: 829bd8ba5c1f64e2c3580a43062b4b11d372b25f75f18cedcd3d03d186bff809
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d7252217055c4d602bf6723b06463fbfc0591c1793a2d72857acfaa1dddd50b66217afbf139afccf79faeccb73804f695b921cfac3c1955ee949e5d8e37cf398
|
|
7
|
+
data.tar.gz: c2d6cff7f176b64d1b048b596f4a09d7ff9140549bdd450a193ca349dcaf74899322c743d0abeca65e046e979da96411feabdffa62ccf89275c6d2e7f6a42ce1
|
data/.dockerignore
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Keep .git so gemspec `git ls-files` works during `bundle install` in the image.
|
|
2
|
+
|
|
3
|
+
# Docs and tooling not needed to run specs in the image
|
|
4
|
+
*.md
|
|
5
|
+
documentation*.md
|
|
6
|
+
.spec
|
|
7
|
+
.rspec_status
|
|
8
|
+
coverage/
|
|
9
|
+
tmp/
|
|
10
|
+
pkg/
|
|
11
|
+
vendor/bundle
|
|
12
|
+
|
|
13
|
+
# OS & env
|
|
14
|
+
.DS_Store
|
|
15
|
+
Thumbs.db
|
|
16
|
+
.env
|
|
17
|
+
.env.*
|
data/.env.example
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# To get started with Dependabot version updates, you'll need to specify which
|
|
2
|
+
# package ecosystems to update and where the package manifests are located.
|
|
3
|
+
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#versioning-strategy
|
|
4
|
+
|
|
5
|
+
version: 2
|
|
6
|
+
updates:
|
|
7
|
+
# Keep the Ruby dependencies up to date
|
|
8
|
+
- package-ecosystem: "bundler"
|
|
9
|
+
directory: "/"
|
|
10
|
+
schedule:
|
|
11
|
+
interval: "weekly"
|
|
12
|
+
day: "monday"
|
|
13
|
+
target-branch: "develop"
|
|
14
|
+
labels:
|
|
15
|
+
- "ruby dependencies"
|
|
16
|
+
groups:
|
|
17
|
+
bundler:
|
|
18
|
+
applies-to: version-updates
|
|
19
|
+
patterns:
|
|
20
|
+
- "*"
|
|
21
|
+
|
|
22
|
+
# Keep the Github Actions dependencies up to date
|
|
23
|
+
- package-ecosystem: "github-actions"
|
|
24
|
+
directory: "/"
|
|
25
|
+
schedule:
|
|
26
|
+
interval: "weekly"
|
|
27
|
+
day: "monday"
|
|
28
|
+
target-branch: "develop"
|
|
29
|
+
labels:
|
|
30
|
+
- "github dependencies"
|
|
31
|
+
groups:
|
|
32
|
+
github:
|
|
33
|
+
applies-to: version-updates
|
|
34
|
+
patterns:
|
|
35
|
+
- "*"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: Auto Assign
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request_target:
|
|
5
|
+
types:
|
|
6
|
+
- opened
|
|
7
|
+
- synchronize
|
|
8
|
+
- reopened
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
pull-requests: write
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
add-assignee:
|
|
16
|
+
name: Auto assign (me only)
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
steps:
|
|
19
|
+
- uses: kentaro-m/auto-assign-action@v2.0.2
|
|
20
|
+
with:
|
|
21
|
+
configuration-path: ".github/auto_assign.yml"
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# For most projects, this workflow file will not need changing; you simply need
|
|
2
|
+
# to commit it to your repository.
|
|
3
|
+
#
|
|
4
|
+
# You may wish to alter this file to override the set of languages analyzed,
|
|
5
|
+
# or to provide custom queries or build logic.
|
|
6
|
+
#
|
|
7
|
+
# ******** NOTE ********
|
|
8
|
+
# We have attempted to detect the languages in your repository. Please check
|
|
9
|
+
# the `language` matrix defined below to confirm you have the correct set of
|
|
10
|
+
# supported CodeQL languages.
|
|
11
|
+
#
|
|
12
|
+
name: "CodeQL Advanced"
|
|
13
|
+
|
|
14
|
+
on:
|
|
15
|
+
push:
|
|
16
|
+
branches: [ "develop" ]
|
|
17
|
+
pull_request:
|
|
18
|
+
branches: [ "develop" ]
|
|
19
|
+
schedule:
|
|
20
|
+
- cron: '19 14 * * 4'
|
|
21
|
+
|
|
22
|
+
permissions:
|
|
23
|
+
security-events: write
|
|
24
|
+
packages: read
|
|
25
|
+
actions: read
|
|
26
|
+
contents: read
|
|
27
|
+
|
|
28
|
+
jobs:
|
|
29
|
+
analyze:
|
|
30
|
+
name: Analyze (${{ matrix.language }})
|
|
31
|
+
# Runner size impacts CodeQL analysis time. To learn more, please see:
|
|
32
|
+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
|
|
33
|
+
# - https://gh.io/supported-runners-and-hardware-resources
|
|
34
|
+
# - https://gh.io/using-larger-runners (GitHub.com only)
|
|
35
|
+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
|
|
36
|
+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
|
|
37
|
+
permissions:
|
|
38
|
+
# required for all workflows
|
|
39
|
+
security-events: write
|
|
40
|
+
|
|
41
|
+
# required to fetch internal or private CodeQL packs
|
|
42
|
+
packages: read
|
|
43
|
+
|
|
44
|
+
# only required for workflows in private repositories
|
|
45
|
+
actions: read
|
|
46
|
+
contents: read
|
|
47
|
+
|
|
48
|
+
strategy:
|
|
49
|
+
fail-fast: false
|
|
50
|
+
matrix:
|
|
51
|
+
include:
|
|
52
|
+
- language: ruby
|
|
53
|
+
build-mode: none
|
|
54
|
+
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
|
|
55
|
+
# Use `c-cpp` to analyze code written in C, C++ or both
|
|
56
|
+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
|
|
57
|
+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
|
|
58
|
+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
|
|
59
|
+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
|
|
60
|
+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
|
|
61
|
+
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
|
|
62
|
+
steps:
|
|
63
|
+
- name: Checkout repository
|
|
64
|
+
uses: actions/checkout@v7
|
|
65
|
+
|
|
66
|
+
# Add any setup steps before running the `github/codeql-action/init` action.
|
|
67
|
+
# This includes steps like installing compilers or runtimes (`actions/setup-node`
|
|
68
|
+
# or others). This is typically only required for manual builds.
|
|
69
|
+
# - name: Setup runtime (example)
|
|
70
|
+
# uses: actions/setup-example@v1
|
|
71
|
+
|
|
72
|
+
# Initializes the CodeQL tools for scanning.
|
|
73
|
+
- name: Initialize CodeQL
|
|
74
|
+
uses: github/codeql-action/init@v4.36.3
|
|
75
|
+
with:
|
|
76
|
+
languages: ${{ matrix.language }}
|
|
77
|
+
build-mode: ${{ matrix.build-mode }}
|
|
78
|
+
# If you wish to specify custom queries, you can do so here or in a config file.
|
|
79
|
+
# By default, queries listed here will override any specified in a config file.
|
|
80
|
+
# Prefix the list here with "+" to use these queries and those in the config file.
|
|
81
|
+
|
|
82
|
+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
|
83
|
+
# queries: security-extended,security-and-quality
|
|
84
|
+
|
|
85
|
+
# If the analyze step fails for one of the languages you are analyzing with
|
|
86
|
+
# "We were unable to automatically build your code", modify the matrix above
|
|
87
|
+
# to set the build mode to "manual" for that language. Then modify this step
|
|
88
|
+
# to build your code.
|
|
89
|
+
# ℹ️ Command-line programs to run using the OS shell.
|
|
90
|
+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
|
91
|
+
- name: Run manual build steps
|
|
92
|
+
if: matrix.build-mode == 'manual'
|
|
93
|
+
shell: bash
|
|
94
|
+
run: |
|
|
95
|
+
echo 'If you are using a "manual" build mode for one or more of the' \
|
|
96
|
+
'languages you are analyzing, replace this with the commands to build' \
|
|
97
|
+
'your code, for example:'
|
|
98
|
+
echo ' make bootstrap'
|
|
99
|
+
echo ' make release'
|
|
100
|
+
exit 1
|
|
101
|
+
|
|
102
|
+
- name: Perform CodeQL Analysis
|
|
103
|
+
uses: github/codeql-action/analyze@v4.36.3
|
|
104
|
+
with:
|
|
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@v7
|
|
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@v7
|
|
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@v7
|
|
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@v7
|
|
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
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Run RSpec tests (VCR cassettes; no live API key needed for recorded specs).
|
|
2
|
+
name: SDK CI
|
|
3
|
+
|
|
4
|
+
on:
|
|
5
|
+
pull_request:
|
|
6
|
+
types: [opened, synchronize, reopened]
|
|
7
|
+
push:
|
|
8
|
+
branches: [main, master]
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
test:
|
|
15
|
+
name: Test
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
env:
|
|
18
|
+
ZEROBOUNCE_API_KEY: "invalid_key_for_tests"
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v7
|
|
21
|
+
|
|
22
|
+
- name: Set up Ruby
|
|
23
|
+
uses: ruby/setup-ruby@v1
|
|
24
|
+
with:
|
|
25
|
+
ruby-version: "3.2"
|
|
26
|
+
bundler-cache: true
|
|
27
|
+
|
|
28
|
+
- name: Run specs
|
|
29
|
+
run: bundle exec rspec
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
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
|
+
|
|
9
|
+
# 2.1.1
|
|
10
|
+
|
|
11
|
+
* Raise development and transitive dependency floors to address security advisories for REXML, Addressable, and YARD (updated `Gemfile.lock`; see `Gemfile` and `zerobounce.gemspec`).
|
|
12
|
+
|
|
1
13
|
# 0.3.0
|
|
2
14
|
* Update ruby and bundler version
|
|
3
15
|
|
data/CODE_OF_CONDUCT.md
CHANGED
|
@@ -54,12 +54,7 @@ further defined and clarified by project maintainers.
|
|
|
54
54
|
|
|
55
55
|
## Enforcement
|
|
56
56
|
|
|
57
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
58
|
-
reported by contacting the project team at afrase91@gmail.com. All
|
|
59
|
-
complaints will be reviewed and investigated and will result in a response that
|
|
60
|
-
is deemed necessary and appropriate to the circumstances. The project team is
|
|
61
|
-
obligated to maintain confidentiality with regard to the reporter of an incident.
|
|
62
|
-
Further details of specific enforcement policies may be posted separately.
|
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the project team at **integrations@zerobounce.net**. All complaints will be reviewed and investigated promptly and fairly. The project team is obligated to maintain confidentiality with regard to the reporter of an incident.
|
|
63
58
|
|
|
64
59
|
Project maintainers who do not follow or enforce the Code of Conduct in good
|
|
65
60
|
faith may face temporary or permanent repercussions as determined by other
|
data/CONTRIBUTING.md
CHANGED
|
@@ -1 +1,112 @@
|
|
|
1
|
-
|
|
1
|
+
# Contributing to Zero Bounce Ruby SDK
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing. This document explains how to get set up, run tests, and submit changes.
|
|
4
|
+
|
|
5
|
+
## Code of Conduct
|
|
6
|
+
|
|
7
|
+
By participating in this project, you agree to uphold our [Code of Conduct](CODE_OF_CONDUCT.md).
|
|
8
|
+
|
|
9
|
+
## Getting Started
|
|
10
|
+
|
|
11
|
+
### Prerequisites
|
|
12
|
+
|
|
13
|
+
* Ruby 3.2+ (see [.ruby-version](.ruby-version))
|
|
14
|
+
* [Bundler](https://bundler.io/) ~> 2.4
|
|
15
|
+
|
|
16
|
+
### Setup
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
git clone https://github.com/zerobounce/zero-bounce-ruby.git
|
|
20
|
+
cd zero-bounce-ruby
|
|
21
|
+
bundle install
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Running Tests
|
|
25
|
+
|
|
26
|
+
Tests use [RSpec](https://rspec.info/) with [VCR](https://github.com/vcr/vcr) for recorded HTTP interactions. Use the placeholder key so cassettes match:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
ZEROBOUNCE_API_KEY=vcr_test_key bundle exec rspec
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Or copy `.env.example` to `.env`, set `ZEROBOUNCE_API_KEY=vcr_test_key`, then:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
bundle exec rspec
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**With Docker:**
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
docker build -t zerobounce-ruby-test .
|
|
42
|
+
docker run --rm zerobounce-ruby-test
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Code Style
|
|
46
|
+
|
|
47
|
+
The project uses [RuboCop](https://github.com/rubocop/rubocop). Run before submitting:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
bundle exec rubocop
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## How to Contribute
|
|
54
|
+
|
|
55
|
+
### Reporting Bugs
|
|
56
|
+
|
|
57
|
+
Open an [issue](https://github.com/zerobounce/zero-bounce-ruby/issues) and include:
|
|
58
|
+
|
|
59
|
+
* Ruby version (`ruby -v`)
|
|
60
|
+
* Steps to reproduce
|
|
61
|
+
* Expected vs actual behavior
|
|
62
|
+
* Relevant code or error messages
|
|
63
|
+
|
|
64
|
+
### Suggesting Changes
|
|
65
|
+
|
|
66
|
+
* Check existing issues and pull requests first.
|
|
67
|
+
* Open an issue to discuss larger changes or API design before coding.
|
|
68
|
+
|
|
69
|
+
### Submitting Changes
|
|
70
|
+
|
|
71
|
+
1. **Fork** the repository and create a branch from `main`:
|
|
72
|
+
```bash
|
|
73
|
+
git checkout -b feature/your-feature-name
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
2. **Make your changes** and add or update tests where relevant.
|
|
77
|
+
|
|
78
|
+
3. **Run the suite** and RuboCop:
|
|
79
|
+
```bash
|
|
80
|
+
ZEROBOUNCE_API_KEY=vcr_test_key bundle exec rspec
|
|
81
|
+
bundle exec rubocop
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
4. **Commit** with a clear message (e.g. `Add X`, `Fix Y`).
|
|
85
|
+
|
|
86
|
+
5. **Push** your branch and open a **Pull Request** against `main`.
|
|
87
|
+
|
|
88
|
+
6. In the PR description, briefly explain what changed and why. Link any related issues.
|
|
89
|
+
|
|
90
|
+
Maintainers will review and may request changes. Once approved, your PR can be merged.
|
|
91
|
+
|
|
92
|
+
## Project Layout
|
|
93
|
+
|
|
94
|
+
* `lib/` – SDK source (entry point: `lib/zerobounce.rb`)
|
|
95
|
+
* `spec/` – RSpec tests and VCR cassettes (`spec/cassettes/`)
|
|
96
|
+
* `data/` – Sample CSV files for batch validation and scoring examples
|
|
97
|
+
|
|
98
|
+
## Re-recording VCR Cassettes
|
|
99
|
+
|
|
100
|
+
If you change or add API calls and need to re-record cassettes:
|
|
101
|
+
|
|
102
|
+
1. Use a valid Zero Bounce API key (e.g. from [dashboard](https://www.zerobounce.net/docs/api-dashboard)).
|
|
103
|
+
2. Set `ZEROBOUNCE_API_KEY` and run the specs; VCR will record new HTTP interactions.
|
|
104
|
+
3. Replace any real API key in the new cassette files with `vcr_test_key` before committing, so the repo never contains real credentials.
|
|
105
|
+
|
|
106
|
+
## Questions
|
|
107
|
+
|
|
108
|
+
* [Zero Bounce API docs](https://www.zerobounce.net/docs/)
|
|
109
|
+
* [Project homepage](https://zerobounce.net)
|
|
110
|
+
* Contact: **integrations@zerobounce.net**
|
|
111
|
+
|
|
112
|
+
Thanks for contributing.
|
data/Dockerfile
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# ZeroBounce Ruby SDK – test image (Ruby 3.2)
|
|
2
|
+
FROM ruby:3.2-alpine
|
|
3
|
+
|
|
4
|
+
RUN apk add --no-cache build-base git
|
|
5
|
+
|
|
6
|
+
WORKDIR /app
|
|
7
|
+
|
|
8
|
+
COPY . .
|
|
9
|
+
# Gemfile.lock expects Bundler 2.4.x (see gemspec); Ruby 3.2 image may ship Bundler 4.x.
|
|
10
|
+
RUN gem install bundler -v 2.4.22 && \
|
|
11
|
+
bundle config set --local path 'vendor/bundle' && \
|
|
12
|
+
bundle _2.4.22_ install
|
|
13
|
+
|
|
14
|
+
# Dummy key for VCR/cassette-based specs; override with env for live API
|
|
15
|
+
ENV ZEROBOUNCE_API_KEY="${ZEROBOUNCE_API_KEY:-invalid_key_for_tests}"
|
|
16
|
+
|
|
17
|
+
CMD ["bundle", "_2.4.22_", "exec", "rspec"]
|
data/Gemfile
CHANGED
|
@@ -7,3 +7,7 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
|
|
7
7
|
# Specify your gem's dependencies in zerobounce.gemspec
|
|
8
8
|
gemspec
|
|
9
9
|
|
|
10
|
+
# Transitive dependency floors (security advisories: REXML DoS/ReDoS, Addressable ReDoS).
|
|
11
|
+
gem 'rexml', '>= 3.4.4'
|
|
12
|
+
gem 'addressable', '>= 2.8.10'
|
|
13
|
+
|
data/Gemfile.lock
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
zerobounce-sdk (
|
|
5
|
-
dotenv
|
|
4
|
+
zerobounce-sdk (2.1.8)
|
|
5
|
+
dotenv
|
|
6
6
|
rest-client (~> 2.1)
|
|
7
7
|
|
|
8
8
|
GEM
|
|
9
9
|
remote: https://rubygems.org/
|
|
10
10
|
specs:
|
|
11
|
-
addressable (2.
|
|
12
|
-
public_suffix (>= 2.0.2, <
|
|
11
|
+
addressable (2.9.0)
|
|
12
|
+
public_suffix (>= 2.0.2, < 8.0)
|
|
13
13
|
ast (2.4.2)
|
|
14
|
+
base64 (0.3.0)
|
|
15
|
+
bigdecimal (4.0.1)
|
|
14
16
|
coderay (1.1.3)
|
|
15
17
|
crack (0.4.5)
|
|
16
18
|
rexml
|
|
@@ -18,24 +20,26 @@ GEM
|
|
|
18
20
|
docile (1.4.0)
|
|
19
21
|
domain_name (0.5.20190701)
|
|
20
22
|
unf (>= 0.0.5, < 1.0.0)
|
|
21
|
-
dotenv (
|
|
23
|
+
dotenv (3.1.8)
|
|
22
24
|
hashdiff (1.0.1)
|
|
23
25
|
http-accept (1.7.0)
|
|
24
26
|
http-cookie (1.0.5)
|
|
25
27
|
domain_name (~> 0.5)
|
|
26
28
|
json (2.6.3)
|
|
29
|
+
logger (1.7.0)
|
|
27
30
|
method_source (1.0.0)
|
|
28
31
|
mime-types (3.5.1)
|
|
29
32
|
mime-types-data (~> 3.2015)
|
|
30
33
|
mime-types-data (3.2023.0808)
|
|
31
34
|
netrc (0.11.0)
|
|
35
|
+
ostruct (0.6.3)
|
|
32
36
|
parallel (1.22.1)
|
|
33
37
|
parser (3.2.2.0)
|
|
34
38
|
ast (~> 2.4.1)
|
|
35
39
|
pry (0.14.2)
|
|
36
40
|
coderay (~> 1.1)
|
|
37
41
|
method_source (~> 1.0)
|
|
38
|
-
public_suffix (
|
|
42
|
+
public_suffix (7.0.5)
|
|
39
43
|
rainbow (3.1.1)
|
|
40
44
|
rake (13.0.6)
|
|
41
45
|
regexp_parser (2.7.0)
|
|
@@ -44,7 +48,7 @@ GEM
|
|
|
44
48
|
http-cookie (>= 1.0.2, < 2.0)
|
|
45
49
|
mime-types (>= 1.16, < 4.0)
|
|
46
50
|
netrc (~> 0.8)
|
|
47
|
-
rexml (3.
|
|
51
|
+
rexml (3.4.4)
|
|
48
52
|
rspec (3.12.0)
|
|
49
53
|
rspec-core (~> 3.12.0)
|
|
50
54
|
rspec-expectations (~> 3.12.0)
|
|
@@ -93,20 +97,28 @@ GEM
|
|
|
93
97
|
unf_ext
|
|
94
98
|
unf_ext (0.0.8.2)
|
|
95
99
|
unicode-display_width (2.4.2)
|
|
96
|
-
vcr (6.
|
|
100
|
+
vcr (6.4.0)
|
|
97
101
|
webmock (3.18.1)
|
|
98
102
|
addressable (>= 2.8.0)
|
|
99
103
|
crack (>= 0.3.2)
|
|
100
104
|
hashdiff (>= 0.4.0, < 2.0.0)
|
|
101
|
-
yard (0.9.
|
|
105
|
+
yard (0.9.43)
|
|
102
106
|
|
|
103
107
|
PLATFORMS
|
|
108
|
+
arm64-darwin-24
|
|
109
|
+
arm64-darwin-25
|
|
104
110
|
x86_64-linux
|
|
105
111
|
|
|
106
112
|
DEPENDENCIES
|
|
113
|
+
addressable (>= 2.8.10)
|
|
114
|
+
base64
|
|
115
|
+
bigdecimal
|
|
107
116
|
bundler (~> 2.4.6)
|
|
117
|
+
logger
|
|
118
|
+
ostruct
|
|
108
119
|
pry (~> 0.14.1)
|
|
109
120
|
rake (~> 13.0)
|
|
121
|
+
rexml (>= 3.4.4)
|
|
110
122
|
rspec (~> 3.0)
|
|
111
123
|
rspec_junit_formatter (~> 0.4.1)
|
|
112
124
|
rubocop (~> 1.15)
|
|
@@ -114,10 +126,10 @@ DEPENDENCIES
|
|
|
114
126
|
rubocop-rake (~> 0.5.1)
|
|
115
127
|
rubocop-rspec (~> 2.3)
|
|
116
128
|
simplecov (~> 0.21.2)
|
|
117
|
-
vcr (~> 6.
|
|
129
|
+
vcr (~> 6.4)
|
|
118
130
|
webmock (~> 3.18)
|
|
119
|
-
yard (~> 0.9.
|
|
131
|
+
yard (~> 0.9.42)
|
|
120
132
|
zerobounce-sdk!
|
|
121
133
|
|
|
122
134
|
BUNDLED WITH
|
|
123
|
-
2.4.
|
|
135
|
+
2.4.22
|