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

Centralize Ruby Version to .ruby-version #171

Merged
merged 5 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/**/*
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.3.0
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.4"
Copy link
Contributor

Choose a reason for hiding this comment

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

@george-ma we have tests using 2.4

- ruby: 2.4
graphql_version: '~> 1.12.18'
- ruby: 2.4
graphql_version: '~> 1.13'

So I updated this to 2.4 instead of 2.7, but now Rubocop requires 2.7. Was there a reason why you had to bump rubocop?

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 it's for this PR rubocop/rubocop#12645 (released in 1.61.0)

This way removing the TargetRubyVersion, Rubocop will use the ruby version defined in the .gemspec instead of the .ruby-version file.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can drop 2.4 now anyway to simplify this. I'll do that


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
4 changes: 2 additions & 2 deletions lib/graphql/batch/loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def prime(key, value)
cache[cache_key(key)] ||= ::Promise.resolve(value).tap { |p| p.source = self }
end

def resolve #:nodoc:
def resolve # :nodoc:
return if resolved?
load_keys = queue
@queue = nil
Expand All @@ -86,7 +86,7 @@ def around_perform
end

# For Promise#sync
def wait #:nodoc:
def wait # :nodoc:
if executor
executor.resolve(self)
else
Expand Down
Loading