Skip to content

Commit 42b77f7

Browse files
committed
πŸŽ‰ Initial release: Hookdeck Ruby SDK
This release introduces the official Ruby SDK for Hookdeck's API. The SDK provides a robust and user-friendly interface for interacting with Hookdeck's webhook platform. ✨ Features: - Complete API coverage for all Hookdeck resources - Comprehensive error handling - Configurable request timeouts - API version support - Ruby 3.0+ compatibility πŸ›  Core Components: - Source management - Destination handling - Connection configuration - Event processing - Transformation support - Retry rules - Bulk operations - Issue management πŸ“š Documentation: - Detailed README with usage examples - Full API documentation - Changelog tracking - Code of conduct πŸ”§ Technical Details: - Built with Faraday for HTTP operations - JSON response parsing - Proper error classification - Thread-safe design - Standard Ruby code style πŸš€ Ready for: - Production deployments - CI/CD integration - Webhook management - Event processing - Custom transformations Version: 0.1.0
0 parents  commit 42b77f7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+2246
-0
lines changed

β€Ž.github/workflows/main.ymlβ€Ž

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Ruby CI/CD
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
clean:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
ruby-version: [ '3.0', '3.1', '3.2', '3.3' ]
16+
17+
name: Ruby ${{ matrix.ruby-version }}
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Set up Ruby
23+
uses: ruby/setup-ruby@v1
24+
with:
25+
ruby-version: ${{ matrix.ruby-version }}
26+
bundler-cache: true
27+
28+
- name: Install dependencies
29+
run: bundle install
30+
31+
- name: Run linter
32+
run: bundle exec standardrb
33+
34+
- name: Run security checks
35+
run: |
36+
gem install bundler-audit
37+
bundle audit check --update
38+

β€Ž.gitignoreβ€Ž

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/.bundle/
2+
/.yardoc
3+
/_yardoc/
4+
/coverage/
5+
/doc/
6+
/pkg/
7+
/spec/reports/
8+
/tmp/
9+
.idea/
10+
hookdeck-*
11+
*.gem

β€Ž.rubocop.ymlβ€Ž

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
AllCops:
2+
NewCops: enable
3+
TargetRubyVersion: 3.0
4+
Exclude:
5+
- 'bin/**/*'
6+
- 'vendor/**/*'
7+
- 'db/**/*'
8+
- 'config/**/*'
9+
- 'script/**/*'
10+
- 'node_modules/**/*'
11+
- 'tmp/**/*'
12+
- 'Gemfile'
13+
- 'Rakefile'
14+
SuggestExtensions: false
15+
16+
Metrics/CyclomaticComplexity:
17+
Max: 15
18+
19+
Metrics/MethodLength:
20+
Max: 35
21+
22+
23+
Metrics/AbcSize:
24+
Max: 35
25+
26+
Metrics/ClassLength:
27+
Max: 300
28+
29+
Metrics/PerceivedComplexity:
30+
Max: 15
31+
32+
Layout/LineLength:
33+
Max: 120
34+
35+
Style/Documentation:
36+
Enabled: false
37+
38+
Style/FrozenStringLiteralComment:
39+
Enabled: false
40+
41+
Style/ClassAndModuleChildren:
42+
EnforcedStyle: nested

β€Ž.standard.ymlβ€Ž

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# For available configuration options, see:
2+
# https://github.com/standardrb/standard
3+
ruby_version: 3.0

β€ŽCHANGELOG.mdβ€Ž

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [0.1.0] - 2024-11-09
9+
10+
### Added
11+
12+
- Initial release of the Hookdeck Ruby SDK
13+
- Basic API client implementation
14+
- Support for managing webhook sources
15+
- Support for managing destinations
16+
- Support for managing connections
17+
- Support for managing events
18+
- Support for managing transformations
19+
- Support for managing retry rules
20+
- Support for managing bulk operations
21+
- Support for managing notifications
22+
- Support for managing issues
23+
- Comprehensive error handling
24+
- Thread-safe HTTP client
25+
- Configurable retries and timeouts
26+
- API version support
27+
- Documentation and examples
28+
29+
### Dependencies
30+
31+
- Faraday for HTTP client
32+
- Faraday Middleware for request/response handling
33+
- JSON for payload handling

β€ŽCODE_OF_CONDUCT.mdβ€Ž

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, caste, color, religion, or sexual
10+
identity and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
20+
* Demonstrating empathy and kindness toward other people
21+
* Being respectful of differing opinions, viewpoints, and experiences
22+
* Giving and gracefully accepting constructive feedback
23+
* Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
* Focusing on what is best not just for us as individuals, but for the overall
26+
community
27+
28+
Examples of unacceptable behavior include:
29+
30+
* The use of sexualized language or imagery, and sexual attention or advances of
31+
any kind
32+
* Trolling, insulting or derogatory comments, and personal or political attacks
33+
* Public or private harassment
34+
* Publishing others' private information, such as a physical or email address,
35+
without their explicit permission
36+
* Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
## Enforcement Responsibilities
40+
41+
Community leaders are responsible for clarifying and enforcing our standards of
42+
acceptable behavior and will take appropriate and fair corrective action in
43+
response to any behavior that they deem inappropriate, threatening, offensive,
44+
or harmful.
45+
46+
Community leaders have the right and responsibility to remove, edit, or reject
47+
comments, commits, code, wiki edits, issues, and other contributions that are
48+
not aligned to this Code of Conduct, and will communicate reasons for moderation
49+
decisions when appropriate.
50+
51+
## Scope
52+
53+
This Code of Conduct applies within all community spaces, and also applies when
54+
an individual is officially representing the community in public spaces.
55+
Examples of representing our community include using an official email address,
56+
posting via an official social media account, or acting as an appointed
57+
representative at an online or offline event.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported to the community leaders responsible for enforcement at
63+
[INSERT CONTACT METHOD].
64+
All complaints will be reviewed and investigated promptly and fairly.
65+
66+
All community leaders are obligated to respect the privacy and security of the
67+
reporter of any incident.
68+
69+
## Enforcement Guidelines
70+
71+
Community leaders will follow these Community Impact Guidelines in determining
72+
the consequences for any action they deem in violation of this Code of Conduct:
73+
74+
### 1. Correction
75+
76+
**Community Impact**: Use of inappropriate language or other behavior deemed
77+
unprofessional or unwelcome in the community.
78+
79+
**Consequence**: A private, written warning from community leaders, providing
80+
clarity around the nature of the violation and an explanation of why the
81+
behavior was inappropriate. A public apology may be requested.
82+
83+
### 2. Warning
84+
85+
**Community Impact**: A violation through a single incident or series of
86+
actions.
87+
88+
**Consequence**: A warning with consequences for continued behavior. No
89+
interaction with the people involved, including unsolicited interaction with
90+
those enforcing the Code of Conduct, for a specified period of time. This
91+
includes avoiding interactions in community spaces as well as external channels
92+
like social media. Violating these terms may lead to a temporary or permanent
93+
ban.
94+
95+
### 3. Temporary Ban
96+
97+
**Community Impact**: A serious violation of community standards, including
98+
sustained inappropriate behavior.
99+
100+
**Consequence**: A temporary ban from any sort of interaction or public
101+
communication with the community for a specified period of time. No public or
102+
private interaction with the people involved, including unsolicited interaction
103+
with those enforcing the Code of Conduct, is allowed during this period.
104+
Violating these terms may lead to a permanent ban.
105+
106+
### 4. Permanent Ban
107+
108+
**Community Impact**: Demonstrating a pattern of violation of community
109+
standards, including sustained inappropriate behavior, harassment of an
110+
individual, or aggression toward or disparagement of classes of individuals.
111+
112+
**Consequence**: A permanent ban from any sort of public interaction within the
113+
community.
114+
115+
## Attribution
116+
117+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118+
version 2.1, available at
119+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120+
121+
Community Impact Guidelines were inspired by
122+
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123+
124+
For answers to common questions about this code of conduct, see the FAQ at
125+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
126+
[https://www.contributor-covenant.org/translations][translations].
127+
128+
[homepage]: https://www.contributor-covenant.org
129+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130+
[Mozilla CoC]: https://github.com/mozilla/diversity
131+
[FAQ]: https://www.contributor-covenant.org/faq
132+
[translations]: https://www.contributor-covenant.org/translations

β€ŽGemfileβ€Ž

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# frozen_string_literal: true
2+
3+
source "https://rubygems.org"
4+
5+
# Specify your gem's dependencies in hookdeck.gemspec
6+
gemspec
7+
8+
group :development, :test do
9+
gem "rake", "~> 13.0"
10+
gem "minitest", "~> 5.16"
11+
gem "standard", "~> 1.3"
12+
end

β€ŽGemfile.lockβ€Ž

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
PATH
2+
remote: .
3+
specs:
4+
hookdeck (0.1.0)
5+
faraday (~> 1.0)
6+
faraday_middleware (~> 1.2)
7+
json (~> 2.0)
8+
9+
GEM
10+
remote: https://rubygems.org/
11+
specs:
12+
ast (2.4.2)
13+
coderay (1.1.3)
14+
faraday (1.10.4)
15+
faraday-em_http (~> 1.0)
16+
faraday-em_synchrony (~> 1.0)
17+
faraday-excon (~> 1.1)
18+
faraday-httpclient (~> 1.0)
19+
faraday-multipart (~> 1.0)
20+
faraday-net_http (~> 1.0)
21+
faraday-net_http_persistent (~> 1.0)
22+
faraday-patron (~> 1.0)
23+
faraday-rack (~> 1.0)
24+
faraday-retry (~> 1.0)
25+
ruby2_keywords (>= 0.0.4)
26+
faraday-em_http (1.0.0)
27+
faraday-em_synchrony (1.0.0)
28+
faraday-excon (1.1.0)
29+
faraday-httpclient (1.0.1)
30+
faraday-multipart (1.0.4)
31+
multipart-post (~> 2)
32+
faraday-net_http (1.0.2)
33+
faraday-net_http_persistent (1.2.0)
34+
faraday-patron (1.0.0)
35+
faraday-rack (1.0.0)
36+
faraday-retry (1.0.3)
37+
faraday_middleware (1.2.1)
38+
faraday (~> 1.0)
39+
json (2.8.1)
40+
language_server-protocol (3.17.0.3)
41+
lint_roller (1.1.0)
42+
method_source (1.1.0)
43+
minitest (5.25.1)
44+
multipart-post (2.4.1)
45+
parallel (1.26.3)
46+
parser (3.3.6.0)
47+
ast (~> 2.4.1)
48+
racc
49+
pry (0.14.2)
50+
coderay (~> 1.1)
51+
method_source (~> 1.0)
52+
racc (1.8.1)
53+
rainbow (3.1.1)
54+
rake (13.2.1)
55+
regexp_parser (2.9.2)
56+
rubocop (1.66.1)
57+
json (~> 2.3)
58+
language_server-protocol (>= 3.17.0)
59+
parallel (~> 1.10)
60+
parser (>= 3.3.0.2)
61+
rainbow (>= 2.2.2, < 4.0)
62+
regexp_parser (>= 2.4, < 3.0)
63+
rubocop-ast (>= 1.32.2, < 2.0)
64+
ruby-progressbar (~> 1.7)
65+
unicode-display_width (>= 2.4.0, < 3.0)
66+
rubocop-ast (1.34.1)
67+
parser (>= 3.3.1.0)
68+
rubocop-capybara (2.21.0)
69+
rubocop (~> 1.41)
70+
rubocop-factory_bot (2.26.1)
71+
rubocop (~> 1.61)
72+
rubocop-performance (1.22.1)
73+
rubocop (>= 1.48.1, < 2.0)
74+
rubocop-ast (>= 1.31.1, < 2.0)
75+
rubocop-rspec (2.31.0)
76+
rubocop (~> 1.40)
77+
rubocop-capybara (~> 2.17)
78+
rubocop-factory_bot (~> 2.22)
79+
rubocop-rspec_rails (~> 2.28)
80+
rubocop-rspec_rails (2.29.1)
81+
rubocop (~> 1.61)
82+
ruby-progressbar (1.13.0)
83+
ruby2_keywords (0.0.5)
84+
standard (1.41.1)
85+
language_server-protocol (~> 3.17.0.2)
86+
lint_roller (~> 1.0)
87+
rubocop (~> 1.66.0)
88+
standard-custom (~> 1.0.0)
89+
standard-performance (~> 1.5)
90+
standard-custom (1.0.2)
91+
lint_roller (~> 1.0)
92+
rubocop (~> 1.50)
93+
standard-performance (1.5.0)
94+
lint_roller (~> 1.1)
95+
rubocop-performance (~> 1.22.0)
96+
unicode-display_width (2.6.0)
97+
yard (0.9.37)
98+
99+
PLATFORMS
100+
arm64-darwin-24
101+
ruby
102+
103+
DEPENDENCIES
104+
bundler (~> 2.0)
105+
hookdeck!
106+
minitest (~> 5.16)
107+
pry (~> 0.14)
108+
rake (~> 13.0)
109+
rubocop (~> 1.0)
110+
rubocop-performance (~> 1.0)
111+
rubocop-rspec (~> 2.0)
112+
standard (~> 1.3)
113+
yard (~> 0.9)
114+
115+
BUNDLED WITH
116+
2.5.23

0 commit comments

Comments
Β (0)