diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a4f3296..2edf964 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.rubocop.yml b/.rubocop.yml index 8e0a2a5..9108e60 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -6,6 +6,5 @@ inherit_from: AllCops: SuggestExtensions: false - TargetRubyVersion: 2.7 Exclude: - vendor/**/* diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..15a2799 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +3.3.0 diff --git a/Gemfile b/Gemfile index 3ed7694..66e5539 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", '~> 1.0.7', require: false diff --git a/Rakefile b/Rakefile index 6c6da42..21267af 100644 --- a/Rakefile +++ b/Rakefile @@ -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) diff --git a/graphql-batch.gemspec b/graphql-batch.gemspec index e981897..b094bd8 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) } @@ -17,7 +19,7 @@ Gem::Specification.new do |spec| 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' diff --git a/lib/graphql/batch/loader.rb b/lib/graphql/batch/loader.rb index 378a982..0484df5 100644 --- a/lib/graphql/batch/loader.rb +++ b/lib/graphql/batch/loader.rb @@ -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 @@ -86,7 +86,7 @@ def around_perform end # For Promise#sync - def wait #:nodoc: + def wait # :nodoc: if executor executor.resolve(self) else