lib/pkgforge/components/cleanup.rb in pkgforge-0.13.0 vs lib/pkgforge/components/cleanup.rb in pkgforge-0.13.1
- old
+ new
@@ -4,12 +4,12 @@
##
# Add cleanup methods to Forge
class Forge
Contract None => nil
def cleanup!
- @tmpdirs ||= {}
- @tmpfiles ||= {}
- paths = [@tmpfiles.values, @tmpdirs.values].flatten
+ state[:tmpdirs] ||= {}
+ state[:tmpfiles] ||= {}
+ paths = state.values_at(:tmpdirs, :tmpfiles).flatten
puts "Cleaning up tmp paths: #{paths}"
FileUtils.rm_rf paths
nil
end
end