Skip to content

Commit

Permalink
Centralize Ruby Version to .ruby-version
Browse files Browse the repository at this point in the history
The `.ruby-version` file is the ecosystem standard for defining a Ruby version.  This PR adds the `.ruby-version` file, ensures a `required_ruby_version` is set, and removes all other references to Ruby in this repository, aligning it with the standard.
> [!IMPORTANT]
> Please verify the following before merging:

Verify that the changes in the PR meets the following requirements or adjust manually to make it compliant:
  - [ ] `.ruby-version` file is present with the correct Ruby version defined
  - [ ] A `required_ruby_version` in your gemspec is set
  - [ ] There is no Ruby version present in the  `dev.yml` Ruby task (before: `- ruby: x.x.x`, after: `- ruby`)
  - [ ] There is no Ruby version/requirement referenced in the `Gemfile` (no lines with `ruby  <some-version>`)
  - [ ] A `Gemfile.lock` is built with the defined Ruby version
  - [ ] The version of Rubocop installed is 1.61.0 or greater
  - [ ] There is no `TargetRubyVersion` defined  in `rubocop.yml` (reads from  `required_ruby_version` on Rubocop 1.61.0)
  - [ ] There is no Ruby argument  present in  `ruby/setup-ruby` Github Actions that do **not**  run on a Ruby matrix (no lines with `ruby-version: “x.x”`)

To establish consistency, the `required_ruby_version` is set to 2.7. If you think that another version is a better fit, please make the applicable changes.

Please merge this PR if it looks good, this PR will be addressed if there isn't any activity after 4 weeks.
  • Loading branch information
george-ma committed Apr 3, 2024
1 parent c3f5aff commit 944706e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: [2.7, 3.1, 3.3]
ruby: [2.7, 3.0, 3.1, 3.2, 3.3]
graphql_version: ['~> 1.12.18', '~> 1.13', '~> 2.0']
include:
- ruby: 2.4
Expand Down
1 change: 0 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ inherit_from:

AllCops:
SuggestExtensions: false
TargetRubyVersion: 2.7
Exclude:
- vendor/**/*
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ gemspec

gem 'graphql', ENV['GRAPHQL_VERSION'] if ENV['GRAPHQL_VERSION']
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.4.0')
gem 'rubocop', '~> 1.12.0', require: false
gem 'rubocop', '~> 1.61.0', require: false
gem "rubocop-shopify", '~> 1.0.7', require: false
end
2 changes: 2 additions & 0 deletions graphql-batch.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Gem::Specification.new do |spec|
spec.homepage = "https://github.com/Shopify/graphql-batch"
spec.license = "MIT"

spec.required_ruby_version = ">= 2.7"

spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
Expand Down

0 comments on commit 944706e

Please sign in to comment.