Sha256: dab8c6cf6ea4c669910dcd936130262e64121ea78553fc7c1bcbb56e910f0edb

Contents?: true

Size: 544 Bytes

Versions: 5

Compression:

Stored size: 544 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!
          tmp_files.each { |file| FileUtils.rm_rf(file) } if reap?
        end
      end

      at_exit { reap! }

    end # FileReaper
  end # WebDriver
end # Selenium

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
selenium-webdriver-0.0.29 lib/selenium/webdriver/common/file_reaper.rb
selenium-webdriver-0.0.28 lib/selenium/webdriver/file_reaper.rb
selenium-webdriver-0.0.27 lib/selenium/webdriver/file_reaper.rb
selenium-webdriver-0.0.26 lib/selenium/webdriver/file_reaper.rb
selenium-webdriver-0.0.25 lib/selenium/webdriver/file_reaper.rb