Skip to content

Commit

Permalink
Merge pull request #171 from Shopify/centralize_ruby_version
Browse files Browse the repository at this point in the history
Centralize Ruby Version to `.ruby-version`
  • Loading branch information
swalkinshaw authored Apr 5, 2024
2 parents c3f5aff + 33fa8d2 commit 584cf07
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 22 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,8 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: [2.7, 3.1, 3.3]
graphql_version: ['~> 1.12.18', '~> 1.13', '~> 2.0']
include:
- ruby: 2.4
graphql_version: '~> 1.12.18'
- ruby: 2.4
graphql_version: '~> 1.13'
ruby: [2.7, 3.0, 3.1, 3.2, 3.3]
graphql_version: ['~> 1.13', '~> 2.0']
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
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
6 changes: 2 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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", '~> 1.0.7', require: false
12 changes: 5 additions & 7 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ end

task(default: :test)

if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.4.0')
task :rubocop do
require 'rubocop/rake_task'
RuboCop::RakeTask.new
end

task(default: :rubocop)
task :rubocop do
require 'rubocop/rake_task'
RuboCop::RakeTask.new
end

task(default: :rubocop)
4 changes: 3 additions & 1 deletion graphql-batch.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ 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) }
spec.require_paths = ["lib"]

spec.metadata['allowed_push_host'] = "https://rubygems.org"

spec.add_runtime_dependency "graphql", ">= 1.12.18", "< 3"
spec.add_runtime_dependency "graphql", ">= 1.13", "< 3"
spec.add_runtime_dependency "promise.rb", "~> 0.7.2"

spec.add_development_dependency "byebug" if RUBY_ENGINE == 'ruby'
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

0 comments on commit 584cf07

Please sign in to comment.