class RuboCop::Cop::Style::InfiniteLoop

def modifier_replacement(node)

def modifier_replacement(node)
  body = node.body
  if node.single_line?
    "loop { #{body.source} }"
  else
    indentation = body.source_range.source_line[LEADING_SPACE]
    ['loop do', body.source.gsub(/^/, indentation(node)), 'end'].join("\n#{indentation}")
  end
end