Skip to content

chore: update dependencies and support modern Ruby - #1

Merged
Halvanhelv merged 1 commit into
mainfrom
chore/update-dependencies-and-ruby
Sep 7, 2026
Merged

Halvanhelv merged 1 commit into
mainfrom
chore/update-dependencies-and-ruby

Conversation

@Halvanhelv

Copy link
Copy Markdown
Owner

Summary

Every runtime dependency was unversioned and the development dependencies were pinned to Ruby 2.3-era releases. This upgrades everything to current versions, adds explicit constraints, and requires Ruby >= 3.2.

Dependencies

gem before after
connection_pool unversioned >= 2.4, < 4.0
deepl-rb unversioned ~> 3.9
dry-initializer unversioned ~> 3.2
ox unversioned ~> 2.14
punkt-segmenter unversioned ~> 0.9
ratelimit unversioned ~> 1.1
redis unversioned >= 5.0, < 7.0
redis-namespace unversioned ~> 1.11
rake ~> 10.0 ~> 13.0
rspec ~> 3.0 ~> 3.13
rubocop unversioned ~> 1.90
simplecov unversioned ~> 1.2
bundler ~> 1.14 removed
codeclimate-test-reporter ~> 1.0.0 removed (unmaintained)

Compatibility fixes

  • Require cgi/escape, digest/md5, forwardable and stringio explicitly. They used to be pulled in transitively, which no longer holds.
  • Pass the DeepL options as a positional hash. deepl-rb declares translate(text, source_lang, target_lang, options = {}), so the **options splat passed nothing when the hash was empty.
  • Replace OpenStruct in the request spec with a Struct; OpenStruct is no longer available without an explicit require.
  • Rename Chunker::Chunk members values/size to texts/bytesize so they stop shadowing Struct#values and Struct#size.
  • Move the Tokenizer constants above the private section, where they are actually reachable.

CI and lint

  • Replace Travis with GitHub Actions: the suite runs against Ruby 3.2, 3.3, 3.4 and 4.0, plus a RuboCop job.
  • Update .rubocop.yml for RuboCop 1.90 — TargetRubyVersion, NewCops: enable, and Metrics/LineLength renamed to Layout/LineLength.

Version

Bumped to 1.1.0.

Test plan

  • bundle exec rspec — 28 examples, 0 failures, on both Ruby 4.0.5 and 3.2.4.
  • bundle exec rubocop — 0 offenses.

Note

The deleted .travis.yml carried a CodeClimate repo_token in plain text. It remains in the git history, so that token should be rotated on the CodeClimate side.

https://claude.ai/code/session_01Pda49PcgziFVnibkKKjXRE

Every runtime dependency was unversioned, and the development
dependencies were pinned to releases from the Ruby 2.3 era. Upgrade
everything to current versions, add explicit version constraints, and
require Ruby >= 3.2.

Fixes needed to run on Ruby 3.2 through 4.0:

  * Require cgi/escape, digest/md5, forwardable and stringio explicitly.
    They used to be pulled in transitively, which no longer holds.
  * Pass the DeepL options as a positional hash. deepl-rb declares
    `translate(text, source_lang, target_lang, options = {})`, so the
    `**options` splat passed nothing when the hash was empty.
  * Replace OpenStruct in the request spec with a Struct. OpenStruct is
    no longer available without an explicit require.

Rename the Chunker::Chunk members from values/size to texts/bytesize so
they stop shadowing Struct#values and Struct#size, and move the
Tokenizer constants above the private section where they are reachable.

Drop the dead codeclimate-test-reporter dependency and replace Travis
with GitHub Actions, running the suite against Ruby 3.2, 3.3, 3.4 and
4.0 plus a RuboCop job. The Travis config also carried a CodeClimate
repo token in plain text.

Update .rubocop.yml for RuboCop 1.90: set TargetRubyVersion, enable new
cops, and rename Metrics/LineLength to Layout/LineLength.

Bump the version to 1.1.0.
@Halvanhelv
Halvanhelv merged commit 4bd59bb into main Sep 7, 2026
5 checks passed
@Halvanhelv
Halvanhelv deleted the chore/update-dependencies-and-ruby branch September 7, 2026 14:27
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