New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Andrew to the hall of fame #928
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,7 +77,7 @@ class SubjectStub < Cop | |
|
||
def on_block(node) | ||
return unless example_group?(node) | ||
return unless (processed_example_groups & node.ancestors).empty? | ||
return if (processed_example_groups & node.ancestors).any? | ||
|
||
processed_example_groups << node | ||
@explicit_subjects = find_all_explicit_subjects(node) | ||
|
@@ -94,7 +94,7 @@ def processed_example_groups | |
end | ||
|
||
def find_all_explicit_subjects(node) | ||
node.each_descendant(:block).each_with_object({}) do |child, h| | ||
node.each_descendant(:block).with_object({}) do |child, h| | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Today I learned about There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. More like 1.9.2 :D https://ruby-doc.org/core-1.9.2/Enumerator.html#method-i-with_object |
||
name = subject(child) | ||
next unless name | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😁 ❤️