class RuboCop::Cop::Style::AutoResourceCleanup

end

f = File.open(‘file’) do
# good
f = File.open(‘file’)
# bad
@example
resource cleanup.
accepting version of a method that does automatic
This cop checks for cases when you could use a block

def on_send(node)

def on_send(node)
  TARGET_METHODS.each do |target_class, target_method|
    target_receiver = s(:const, nil, target_class)
    next if node.receiver != target_receiver
    next if node.method_name != target_method
    next if node.parent && node.parent.block_type?
    next if node.block_argument?
    add_offense(node, :expression,
                format(MSG, target_class, target_method))
  end
end