Ruby logoRuby/
RB-ST1007

A block can be used that cleans up resources automatically on closingRB-ST1007

Major severityMajor
Style categoryStyle

A block accepting version of the method can be used that does automatic resource cleanup.

Bad practice

f = File.open('file')
File.open('file') do |f|
  # ...
end