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 8e5e083
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,7 @@ Style/PercentLiteralDelimiters:
PreferredDelimiters:
'%i': ()
'%w': ()

# Broken when trying to be compatibale with ruby < 3.3 and >= 3.3
Naming/BlockForwarding:
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

0 comments on commit 8e5e083

Please sign in to comment.