Skip to content

Commit

Permalink
Rubocop fixes for ruby 3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
mkon committed Feb 15, 2024
1 parent f9b1dd3 commit 7d07b93
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,9 @@ Style/PercentLiteralDelimiters:
PreferredDelimiters:
'%i': ()
'%w': ()

# Broken when trying to be compatibale with ruby < 3.3 and >= 3.3
Naming/BlockForwarding:
Enabled: false
Style/ArgumentsForwarding:
Enabled: false
8 changes: 4 additions & 4 deletions lib/openapi_contracts/doc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,20 @@ def operation_for(path, method)
end

# Returns an Enumerator over all Operations
def operations(&block) # rubocop:disable Naming/BlockForwarding
def operations(&block)
return enum_for(:operations) unless block_given?

paths.each do |path|
path.operations.each(&block) # rubocop:disable Naming/BlockForwarding
path.operations.each(&block)
end
end

# Returns an Enumerator over all Responses
def responses(&block) # rubocop:disable Naming/BlockForwarding
def responses(&block)
return enum_for(:responses) unless block_given?

operations.each do |operation|
operation.responses.each(&block) # rubocop:disable Naming/BlockForwarding
operation.responses.each(&block)
end
end

Expand Down
2 changes: 1 addition & 1 deletion openapi_contracts.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Gem::Specification.new do |s|

s.add_development_dependency 'json_spec', '~> 1.1.5'
s.add_development_dependency 'rspec', '~> 3.13.0'
s.add_development_dependency 'rubocop', '1.59.0'
s.add_development_dependency 'rubocop', '1.60.2'
s.add_development_dependency 'rubocop-rspec', '2.26.1'
s.add_development_dependency 'simplecov', '~> 0.22.0'
s.metadata['rubygems_mfa_required'] = 'true'
Expand Down

0 comments on commit 7d07b93

Please sign in to comment.