From f77bbd99a4ab89252d2eb2f114f0270a218a0a55 Mon Sep 17 00:00:00 2001 From: George Ma Date: Wed, 3 Apr 2024 15:50:34 -0400 Subject: [PATCH] Centralize Ruby Version to `.ruby-version` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 `) - [ ] 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. --- .github/workflows/ci.yml | 2 +- .gitignore | 1 - Gemfile | 6 ++-- Gemfile.lock | 60 ++++++++++++++++++++++++++++++++++++++++ graphql-batch.gemspec | 2 ++ 5 files changed, 65 insertions(+), 6 deletions(-) create mode 100644 Gemfile.lock diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a4f3296..ed0226c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.gitignore b/.gitignore index 2fac043..9106b2a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ /.bundle/ /.yardoc -/Gemfile*.lock /_yardoc/ /coverage/ /doc/ diff --git a/Gemfile b/Gemfile index 3ed7694..b8728c6 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,5 @@ source 'https://rubygems.org' 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-shopify", '~> 1.0.7', require: false -end +gem 'rubocop', '~> 1.61.0', require: false +gem "rubocop-shopify", require: false diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..460d4e4 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,60 @@ +PATH + remote: . + specs: + graphql-batch (0.6.0) + graphql (>= 1.12.18, < 3) + promise.rb (~> 0.7.2) + +GEM + remote: https://rubygems.org/ + specs: + ast (2.4.2) + base64 (0.2.0) + byebug (11.1.3) + graphql (2.3.0) + base64 + json (2.7.1) + language_server-protocol (3.17.0.3) + minitest (5.22.3) + parallel (1.24.0) + parser (3.3.0.5) + ast (~> 2.4.1) + racc + promise.rb (0.7.4) + racc (1.7.3) + rainbow (3.1.1) + rake (13.2.0) + regexp_parser (2.9.0) + rexml (3.2.6) + rubocop (1.61.0) + json (~> 2.3) + language_server-protocol (>= 3.17.0) + parallel (~> 1.10) + parser (>= 3.3.0.2) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.30.0, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.31.2) + parser (>= 3.3.0.4) + rubocop-shopify (2.15.1) + rubocop (~> 1.51) + ruby-progressbar (1.13.0) + unicode-display_width (2.5.0) + +PLATFORMS + arm64-darwin-23 + ruby + +DEPENDENCIES + byebug + graphql-batch! + minitest + rake (>= 12.3.3) + rubocop (~> 1.61.0) + rubocop-shopify + +BUNDLED WITH + 2.5.3 diff --git a/graphql-batch.gemspec b/graphql-batch.gemspec index e981897..68dfd31 100644 --- a/graphql-batch.gemspec +++ b/graphql-batch.gemspec @@ -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) }