Skip to content

Use require_relative, bump to Ruby 4.0, drop ActiveSupport and upgrade to minitest 6 - #149

Merged
hmcguire-shopify merged 4 commits into
mainfrom
sf/ac4bfe5e-4c06-44c8-bcc2-32abaa59f61d
Nov 11, 2026
Merged

hmcguire-shopify merged 4 commits into
mainfrom
sf/ac4bfe5e-4c06-44c8-bcc2-32abaa59f61d

Conversation

@hmcguire-shopify

Copy link
Copy Markdown
Contributor

A handful of maintenance changes, one per commit:

  • Use require_relative for internal requires. lib/graphql/metrics.rb loads its own files with require_relative "metrics/..." instead of searching $LOAD_PATH. The gemspec already did this for the version file.
  • Bump development Ruby to 4.0.9. Updates .ruby-version, adds Ruby 4.0 to the CI matrix, and raises required_ruby_version to >= 3.3 (3.1 and 3.2 are end of life). Ruby 4.0 no longer ships ostruct as a default gem, so the unused require 'ostruct' in the test helper goes, and pry / pry-byebug / byebug move to versions that don't need it. minitest 5.25 doesn't allow Ruby 4.0, so the lock moves to 5.27 in this commit.
  • Remove ActiveSupport from the test suite. The integration test only used it for the test "..." do macro and present?. It's now a plain Minitest::Test with def test_* methods and assert_nil / refute_empty, and the activesupport development dependency is gone.
  • Upgrade minitest to 6. Requires ~> 6.0 (minitest-focus 1.4.1 allows it) and replaces the one assert_equal(nil, ...), which minitest 6 rejects.

Lockfile changes were made with bundle lock --update <gems> --conservative, so no other gems moved.

Tested locally: bundle exec rake test passes (28 runs, 0 failures) on Ruby 4.0.9 and 3.4 with the root Gemfile, and on Ruby 4.0.9 with gemfiles/graphql_2.3.gemfile.

Loading the gem's own files with require_relative avoids a $LOAD_PATH search for each one and guarantees the files come from this gem rather than whatever else is on the load path.

Co-authored-by: Hartley McGuire <hartley.mcguire@shopify.com>
Set .ruby-version to 4.0.9 and add Ruby 4.0 to the CI matrix. Ruby 3.1
and 3.2 are end of life, so require Ruby 3.3 or newer and drop them from
the matrix.

Ruby 4.0 no longer ships ostruct as a default gem, so drop the unused
require from the test helper and update pry, pry-byebug and byebug to
versions that don't need it. minitest 5.25 doesn't allow Ruby 4.0, so
it moves to 5.27.

Co-authored-by: Hartley McGuire <hartley.mcguire@shopify.com>
The integration test only used ActiveSupport for the `test` macro and
`present?`. Make it a plain Minitest::Test with `def test_*` methods and
use assert_nil / refute_empty directly, then drop the development
dependency.

Co-authored-by: Hartley McGuire <hartley.mcguire@shopify.com>
Now that ActiveSupport no longer pins minitest below 6, require ~> 6.0
and move minitest-focus to 1.4.1, which allows it. Replace the one
assert_equal(nil, ...) with assert_nil, since minitest 6 rejects it.

Co-authored-by: Hartley McGuire <hartley.mcguire@shopify.com>
@hmcguire-shopify
hmcguire-shopify marked this pull request as ready for review November 10, 2026 23:30

@paracycle paracycle left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Amazing, thanks!

@hmcguire-shopify
hmcguire-shopify merged commit aa3d405 into main Nov 11, 2026
14 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