This cop checks for redundant `begin` blocks.
Currently it checks for code like this:
@example
def test begin ala bala rescue StandardError => e something end end
# File lib/rubocop/cop/style/redundant_begin.rb, line 30 def autocorrect(node) @corrections << lambda do |corrector| child = node.children.first begin_indent = node.loc.column child_indent = child.loc.column indent_diff = child_indent - begin_indent corrector.replace( range_with_surrounding_space(node.loc.expression), range_with_surrounding_space( child.loc.expression ).source.gsub(/^\s{#{indent_diff}}/, '') ) end end
Generated with the Darkfish Rdoc Generator 2.