class RuboCop::Cop::Lint::Loop

Checks for uses of ‘begin…end while/until something`.

@safety

The cop is unsafe because behavior can change in some cases, including
if a local variable inside the loop body is accessed outside of it, or if the
loop body raises a `StopIteration` exception (which `Kernel#loop` rescues).

@example

# bad

# using while
begin
  do_something
end while some_condition

# good

# while replacement
loop do
  do_something
  break unless some_condition
end

# bad

# using until
begin
  do_something
end until some_condition

# good

# until replacement
loop do
  do_something
  break if some_condition
end