Skip to content

Commit

Permalink
Fix erroneous autocorrect of Style/HashEachMethods cop
Browse files Browse the repository at this point in the history
Hash#sort returns an Array instance, and Array does not have `each_value`.
https://docs.rubocop.org/rubocop/cops_style.html#stylehasheachmethods
> If you have an array of two-element arrays, you can put parentheses around the block arguments to indicate that you’re not working with a hash, and suppress RuboCop offenses.
  • Loading branch information
mishina2228 committed Dec 29, 2023
1 parent c49d3e6 commit 995fe39
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/god.rb
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ def self.control(name, command)
# Returns true on success, false if all tasks could not be stopped within 10
# seconds
def self.stop_all
watches.sort.each_value do |w|
watches.sort.each do |(_name, w)|
Thread.new do
w.action(:stop)
w.unmonitor if w.state != :unmonitored
Expand Down

0 comments on commit 995fe39

Please sign in to comment.