diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 04705e4..be4d1bd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,7 +4,7 @@ jobs: build: strategy: matrix: - version: ["ruby:3.4", "ruby:3.3", "ruby:3.2"] + version: ["ruby:4.0", "ruby:3.4", "ruby:3.3"] runs-on: ubuntu-latest container: ${{ matrix.version }} steps: diff --git a/.rubocop.yml b/.rubocop.yml index 26fd590..fe8ec3a 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,7 +1,7 @@ AllCops: NewCops: enable SuggestExtensions: false - TargetRubyVersion: 3.1 + TargetRubyVersion: 3.2 Layout/LineLength: Enabled: 100 Metrics/BlockLength: diff --git a/.ruby-version b/.ruby-version index f989260..1454f6e 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.4.4 +4.0.1 diff --git a/Gemfile b/Gemfile index 1c81bb5..476e658 100644 --- a/Gemfile +++ b/Gemfile @@ -17,4 +17,7 @@ gem 'webmock' # Used as a web server for integration testing actual HTTP requests. gem 'webrick' +# Used to test logging. +gem 'logger' + gemspec diff --git a/lib/reynard/request_context.rb b/lib/reynard/request_context.rb index 044f5f1..912dc99 100644 --- a/lib/reynard/request_context.rb +++ b/lib/reynard/request_context.rb @@ -8,8 +8,7 @@ class Reynard :operation, :headers, :params, - :body, - keyword_init: true + :body ) do def verb operation&.verb diff --git a/lib/reynard/specification.rb b/lib/reynard/specification.rb index 04b6481..9695f52 100644 --- a/lib/reynard/specification.rb +++ b/lib/reynard/specification.rb @@ -25,8 +25,8 @@ def dig(*path) # specification.find_each(type: 'object') {} # # Please don't use this in a hot paths in production, primarily meant for testing and tooling. - def find_each(type:, &block) - Finder.new(specification: self, query: Query.new(type:)).find_each(&block) + def find_each(type:, &) + Finder.new(specification: self, query: Query.new(type:)).find_each(&) end def servers diff --git a/reynard.gemspec b/reynard.gemspec index 82e98d0..b8a769b 100644 --- a/reynard.gemspec +++ b/reynard.gemspec @@ -27,7 +27,7 @@ Gem::Specification.new do |spec| ] spec.require_paths = ['lib'] - spec.required_ruby_version = '> 3.1' + spec.required_ruby_version = '> 3.2' spec.add_dependency 'multi_json' spec.add_dependency 'net-http-persistent' diff --git a/test/reynard/object_builder_test.rb b/test/reynard/object_builder_test.rb index e79a6d6..955b7bd 100644 --- a/test/reynard/object_builder_test.rb +++ b/test/reynard/object_builder_test.rb @@ -130,7 +130,7 @@ def setup end class WeirdObjectBuilderTest < Reynard::Test - Response = Struct.new(:body, keyword_init: true) + Response = Struct.new(:body) def setup @specification = Specification.new(filename: fixture_file('openapi/weird.yml')) @@ -307,7 +307,7 @@ def setup end class PolymorphicBuilderTest < Reynard::Test - Response = Struct.new(:body, keyword_init: true) + Response = Struct.new(:body) def setup @specification = Specification.new(filename: fixture_file('openapi/polymorphic.yml')) diff --git a/test/support/simple_service.rb b/test/support/simple_service.rb index ac9812e..8801d94 100644 --- a/test/support/simple_service.rb +++ b/test/support/simple_service.rb @@ -4,7 +4,7 @@ require 'webrick' class SimpleService - Options = Struct.new(:port, keyword_init: true) + Options = Struct.new(:port) class Servlet < WEBrick::HTTPServlet::AbstractServlet def initialize(*)