Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that docker-api works with frozen strings #590

Merged
merged 3 commits into from
Oct 30, 2024

Conversation

bquorning
Copy link
Contributor

I think after Ruby 3.4 is released1, more people will start expecting libraries to be functional with e.g. the --enable-frozen-string-literal option enabled.

This PR adds the frozen_string_literal header to all files and fixes failing tests.

This PR also configures CI to run tests with Ruby versions 3.0 up to 3.3. This in turn means that the cane gem had to be removed. It was last updated 6 years ago, and that last change was telling people to start using RuboCop instead (however, I feel such a change is out of scope for this PR).

Footnotes

  1. https://github.com/ruby/ruby/commit/12be40ae6be78ac41e8e3f3c313cc6f63e7fa6c4

@bquorning bquorning marked this pull request as ready for review October 28, 2024 18:52
@ls-todd-lunter
Copy link
Contributor

This looks great. One question, but otherwise I'd be happy to merge.

Rakefile Outdated
require 'bundler/setup'

ENV['PATH'] = "/opt/docker/:#{ENV['PATH']}" if ENV['CI'] == 'true'

require 'docker'
require 'rspec/core/rake_task'
require 'cane/rake_task'


desc 'Run the full test suite from scratch'
task :default => [:unpack, :rspec, :quality]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, can we also remove the quality from this array?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, of course. Sorry I missed that.

I also now noticed a mention of rake quality in the Readme; that has been removed as well.

It doesn't work with Ruby 3.1+, and in 2018 its maintainer wrote that
users should consider switching to RuboCop.
@ls-todd-lunter
Copy link
Contributor

Seems like the #dockerfile_for method also needs the + to make sure it's mutable.

I think after Ruby 3.4 is released[^1], more people will start expecting
libraries to be functional with eg the `--enable-frozen-string-literal`
option enabled.

This commit adds the `frozen_string_literal` header to all files and
fixes failing tests.

[^1]:ruby/ruby@12be40a
@bquorning
Copy link
Contributor Author

Fixed and pushed.

@ls-todd-lunter ls-todd-lunter merged commit 60f2c78 into upserve:master Oct 30, 2024
24 checks passed
@ls-todd-lunter
Copy link
Contributor

Released as v2.4.0

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