Sha256: 4a155f49c68621ae9cc5df412b115a1c14ffe69fe51b152d27d65045050ce78e
Contents?: true
Size: 804 Bytes
Versions: 11
Compression:
Stored size: 804 Bytes
Contents
module Selenium module WebDriver module FileReaper class << self def reap=(bool) @reap = bool end def reap? @reap = true unless defined?(@reap) !!@reap end def tmp_files @tmp_files ||= [] end def <<(file) tmp_files << file end def reap(file) return unless reap? unless tmp_files.include?(file) raise Error::WebDriverError, "file not added for reaping: #{file.inspect}" end FileUtils.rm_rf tmp_files.delete(file) end def reap! tmp_files.each { |file| FileUtils.rm_rf(file) } if reap? end end at_exit { reap! } end # FileReaper end # WebDriver end # Selenium
Version data entries
11 entries across 11 versions & 1 rubygems