Contributions are welcome: bug reports, fixes, new examples, and documentation improvements.
- Search existing issues first
- Open an issue before large changes to discuss the approach
- All contributions must pass the test suite
Prerequisites: Ruby 2.7+ and Bundler. Or use Docker (no local Ruby needed).
git clone https://github.com/boxlinknet/kwtsms-ruby.git
cd kwtsms-ruby
bundle installVerify:
bundle exec rake testWith Docker (no local Ruby):
docker run --rm -v "$(pwd):/app" -w /app ruby:3.3-slim bash -c \
"apt-get update -qq && apt-get install -y -qq build-essential > /dev/null 2>&1 && bundle install --quiet && bundle exec rake test"Three tiers of tests:
# Tier 1: Unit tests (no network, no credentials)
bundle exec rake test
# Tier 2: Mocked API tests (included in rake test, uses webmock)
# No extra command needed, they run with unit tests
# Tier 3: Integration tests (real API, requires credentials)
RUBY_USERNAME=ruby_username RUBY_PASSWORD=ruby_password bundle exec rake test_integration
# All tests
bundle exec rake test_all
# Single file
bundle exec ruby -Ilib:test test/test_phone.rb
# Single method
bundle exec ruby -Ilib:test test/test_phone.rb -n test_valid_kuwait_mobilegem build kwtsms.gemspec
# Output: kwtsms-X.Y.Z.gem in the current directorylib/kwtsms.rb # Entry point, requires all modules
lib/kwtsms/client.rb # KwtSMS::Client class (verify, balance, send_sms, etc.)
lib/kwtsms/phone.rb # Phone normalization, country validation (PHONE_RULES)
lib/kwtsms/message.rb # Message cleaning (emojis, HTML, hidden chars)
lib/kwtsms/errors.rb # API_ERRORS map, enrich_error()
lib/kwtsms/request.rb # HTTP transport (Net::HTTP, JSON, logging)
lib/kwtsms/env_loader.rb # .env file parser
lib/kwtsms/logger.rb # JSONL logger (password masking)
lib/kwtsms/version.rb # KwtSMS::VERSION
test/test_helper.rb # Minitest + webmock setup
test/test_phone.rb # Phone normalization and validation tests
test/test_message.rb # Message cleaning tests
test/test_client.rb # Client methods with mocked API responses
test/test_errors.rb # Error enrichment tests
test/test_integration.rb # Real API tests (skipped without credentials)
feat/short-description
fix/short-description
docs/short-description
test/short-description
refactor/short-description
chore/short-description
feat: add status() method for message queue lookup
fix: handle ERR028 in bulk send
docs: add Next.js example
test: cover Arabic digit normalization
chore: bump dependency versions
Follow TDD:
- Write a failing test in the appropriate test file
- Run
bundle exec rake testand verify it fails - Implement the method
- Run tests again and verify it passes
- Export the method if it should be public
- Add documentation to README.md
- Update CHANGELOG.md under
[Unreleased]
- Fork the repo and create your branch from
main - Make your changes with tests
- Run the full test suite:
bundle exec rake test - Update CHANGELOG.md under
[Unreleased] - Open a PR against
main
- [ ] All existing tests pass
- [ ] New code has tests
- [ ] No external runtime dependencies added
- [ ] Ruby 2.7+ compatibility maintained
- [ ] CHANGELOG.md updated under [Unreleased]
- [ ] Public types exported if new public types added
Open an issue at https://github.com/boxlinknet/kwtsms-ruby/issues with:
- Ruby version (
ruby -v) - Gem version (
KwtSMS::VERSION) - Steps to reproduce
- Expected vs actual behavior
Do NOT open a public GitHub issue for security vulnerabilities.
Report via email: info@boxlink.net. See SECURITY.md for details.
By contributing, you agree that your contributions will be licensed under the MIT License.