Skip to content

Drop support for Ruby < 2.7 - #617

Merged
ls-todd-lunter merged 1 commit into
upserve:masterfrom
tas50:drop-ruby-before-2-7
Oct 27, 2026
Merged

ls-todd-lunter merged 1 commit into
upserve:masterfrom
tas50:drop-ruby-before-2-7

Conversation

@tas50

@tas50 tas50 commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Drops support for Ruby 2.4, 2.5, and 2.6, all of which reached end of life between 2020 and 2022. Keeping them in CI has started to hold back changes; #610, for example, had to avoid Kernel#yield_self for 2.4.

  • required_ruby_version = '>= 2.7' in the gemspec, so Bundler refuses to resolve the gem on older Rubies instead of letting it fail at runtime.
  • Removes 2.4, 2.5, and 2.6 from both the Docker and Podman CI matrices.
  • Simplifies Docker::Image.import to call URI.open directly. The old branch fell back to Kernel#open for Rubies without URI.open, which was added in 2.5. URI.open still handles local file paths, because open-uri passes non-URI strings through to Kernel#open.

Because this drops supported Ruby versions, the next release should probably be a major version bump. I've left VERSION alone for the maintainers to decide.

This also unblocks a follow-up to #613: requiring json >= 2.10, whose rewritten parser needs Ruby 2.7+, would give every supported Ruby the fast parser.

Testing

  • image_spec .import, util_spec, and docker_spec against Docker 29.9: 67 examples, 0 failures on both Ruby 2.7 and Ruby 4.0.
  • On Ruby 2.6, bundle install now fails as intended: Could not find gem 'ruby (>= 2.7)', which is required by gem 'docker-api'.

Ruby 2.4, 2.5, and 2.6 reached end of life between 2020 and 2022.

- Set required_ruby_version to >= 2.7 so Bundler won't resolve the gem on
  older Rubies
- Remove 2.4, 2.5, and 2.6 from the Docker and Podman CI matrices
- Call URI.open directly in Image.import. The Kernel#open fallback was
  only needed before URI.open existed (Ruby 2.5)

Signed-off-by: Tim Smith <tsmith84@proton.me>
@ls-todd-lunter
ls-todd-lunter merged commit 1a65904 into upserve:master Oct 27, 2026
24 checks passed
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.

2 participants