Skip to content

chore!: modernize gem for v5.0.0#45

Merged
svyatov merged 5 commits into
masterfrom
chore/modernize-gem
Mar 2, 2026
Merged

chore!: modernize gem for v5.0.0#45
svyatov merged 5 commits into
masterfrom
chore/modernize-gem

Conversation

@svyatov
Copy link
Copy Markdown
Owner

@svyatov svyatov commented Mar 2, 2026

Summary

  • Modernize gem for v5.0.0: drop legacy Ruby support, replace hash options with kwargs throughout, remove Util module, update gemspec metadata, add GitHub Actions CI replacing Travis CI
  • Refactor internals: HTTPWrapper and Request classes now use keyword arguments; constants use lowercase header names; cleaner define_method blocks
  • Achieve 100% test coverage: add unit tests for multipart form data, string body, verify_cert: false, PUT with body, and constructor kwargs; add WEBrick-based integration test suite exercising real HTTP/HTTPS requests

Breaking changes

  • Minimum Ruby version raised (see gemspec)
  • HTTPWrapper::Util removed — use HTTPWrapper directly
  • Constructor and request methods now use keyword arguments instead of options hash

Test plan

  • bundle exec rspec — 47 examples, 0 failures
  • COVERAGE=1 bundle exec rspec — 100% line coverage (137/137)
  • bundle exec rubocop — 0 offenses

svyatov added 5 commits March 2, 2026 20:40
Drop Ruby < 3.2, migrate CI from Travis to GitHub Actions,
update all dev dependencies to latest versions (RuboCop 1.84,
SimpleCov 0.22, WebMock 3.26), modernize gemspec with MFA
metadata, move dev deps to Gemfile, add community files
(CONTRIBUTING, CODE_OF_CONDUCT, SECURITY, issue/PR templates),
rewrite CHANGELOG in Keep a Changelog format, and apply
RuboCop auto-fixes from the 0.80 → 1.84 upgrade.

BREAKING CHANGE: minimum Ruby version raised from 2.5 to 3.2
- Switch constructor and request methods to keyword arguments, giving
  ArgumentError on typos for free and removing UnknownKeyError/Util
- Replace fragile const_get lookups with frozen hash tables
  (HTTP_METHODS, HEADERS_FOR_REQUEST_TYPE)
- Inline Util.query_to_hash/hash_to_query as direct URI calls, delete
  util.rb
- Rename private methods: set_* → apply_*, get_response → perform_request
- Add write_timeout to connection setup
- Fix AJAX_JSON_HEADER to use merge instead of dup.merge!
Cover previously untested code paths: multipart form data, string body,
verify_cert: false, PUT with body, and constructor kwargs. Add WEBrick-based
integration tests exercising real HTTP/HTTPS requests including redirects,
cookies, headers, and basic auth.
Remove nonexistent SOAP methods, fix HTTPWrapper typo, update
UnknownKeyError → ArgumentError to match kwargs behavior.
@svyatov svyatov merged commit 96f451b into master Mar 2, 2026
5 checks passed
@svyatov svyatov deleted the chore/modernize-gem branch March 2, 2026 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant