Skip to content

Commit

Permalink
Drop Ruby 2.5 and 2.6 support (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
exoego committed Mar 25, 2024
1 parent 97dbeb1 commit bd48dae
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
ruby-version: 3.3
bundler-cache: true

- name: Rubocop run
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ jobs:
fail-fast: false
matrix:
include:
- ruby: ruby:2.5
- ruby: ruby:2.6
- ruby: ruby:2.7
- ruby: ruby:3.0
- ruby: ruby:3.1
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ inherit_from: .rubocop_todo.yml
AllCops:
NewCops: enable
SuggestExtensions: false
TargetRubyVersion: 2.5
TargetRubyVersion: 2.7
Exclude:
- 'spec/rails/**/*'
- 'vendor/**/*'
Expand Down
2 changes: 1 addition & 1 deletion lib/rspec/openapi/minitest_hooks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def run(*args)
file_path = method(name).source_location.first
human_name = name.sub(/^test_/, '').gsub('_', ' ')
example = Example.new(self, human_name, {}, file_path)
path = RSpec::OpenAPI.path.yield_self { |p| p.is_a?(Proc) ? p.call(example) : p }
path = RSpec::OpenAPI.path.then { |p| p.is_a?(Proc) ? p.call(example) : p }
record = RSpec::OpenAPI::RecordBuilder.build(self, example: example)
RSpec::OpenAPI.path_records[path] << record if record
end
Expand Down
2 changes: 1 addition & 1 deletion lib/rspec/openapi/rspec_hooks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

RSpec.configuration.after(:each) do |example|
if RSpec::OpenAPI.example_types.include?(example.metadata[:type]) && example.metadata[:openapi] != false
path = RSpec::OpenAPI.path.yield_self { |p| p.is_a?(Proc) ? p.call(example) : p }
path = RSpec::OpenAPI.path.then { |p| p.is_a?(Proc) ? p.call(example) : p }
record = RSpec::OpenAPI::RecordBuilder.build(self, example: example)
RSpec::OpenAPI.path_records[path] << record if record
end
Expand Down
4 changes: 2 additions & 2 deletions lib/rspec/openapi/schema_merger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ def merge!(base, spec)
def normalize_keys(spec)
case spec
when Hash
spec.map do |key, value|
spec.to_h do |key, value|
[key.to_s, normalize_keys(value)]
end.to_h
end
when Array
spec.map { |s| normalize_keys(s) }
else
Expand Down
2 changes: 1 addition & 1 deletion rspec-openapi.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
spec.description = 'Generate OpenAPI from RSpec request specs'
spec.homepage = 'https://github.com/exoego/rspec-openapi'
spec.license = 'MIT'
spec.required_ruby_version = Gem::Requirement.new('>= 2.5.0')
spec.required_ruby_version = Gem::Requirement.new('>= 2.7.0')

spec.metadata = {
'homepage_uri' => 'https://github.com/exoego/rspec-openapi',
Expand Down

0 comments on commit bd48dae

Please sign in to comment.