berkshelf / ridley

A reliable Chef API client with a clean syntax
Other
231 stars 85 forks source link

Fix File.delete('metadata.json') bug on Windows #294

Closed webcoyote closed 9 years ago

webcoyote commented 9 years ago

Fixes #292

On Windows the metadata.json file occasionally cannot be deleted. The source of the bug is (1) open file handles cannot be deleted in Windows and (2) the Ruby Garbage Collector still holds a reference to the file object. Running GC.start before deleting the file fixes the problem.