chore: update dependencies and support modern Ruby - #1
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
>= 2.4, < 4.0~> 3.9~> 3.2~> 2.14~> 0.9~> 1.1>= 5.0, < 7.0~> 1.11~> 10.0~> 13.0~> 3.0~> 3.13~> 1.90~> 1.2~> 1.14~> 1.0.0Compatibility fixes
cgi/escape,digest/md5,forwardableandstringioexplicitly. They used to be pulled in transitively, which no longer holds.deepl-rbdeclarestranslate(text, source_lang, target_lang, options = {}), so the**optionssplat passed nothing when the hash was empty.OpenStructin the request spec with aStruct;OpenStructis no longer available without an explicit require.Chunker::Chunkmembersvalues/sizetotexts/bytesizeso they stop shadowingStruct#valuesandStruct#size.Tokenizerconstants above theprivatesection, where they are actually reachable.CI and lint
.rubocop.ymlfor RuboCop 1.90 —TargetRubyVersion,NewCops: enable, andMetrics/LineLengthrenamed toLayout/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.ymlcarried a CodeClimaterepo_tokenin plain text. It remains in the git history, so that token should be rotated on the CodeClimate side.https://claude.ai/code/session_01Pda49PcgziFVnibkKKjXRE