Class: Capybara::Playwright::TmpdirOwner::TmpdirRemover
- Inherits:
-
Object
- Object
- Capybara::Playwright::TmpdirOwner::TmpdirRemover
- Defined in:
- lib/capybara/playwright/tmpdir_owner.rb
Instance Method Summary collapse
- #call(*args) ⇒ Object
-
#initialize(tmpdir) ⇒ TmpdirRemover
constructor
A new instance of TmpdirRemover.
Constructor Details
#initialize(tmpdir) ⇒ TmpdirRemover
Returns a new instance of TmpdirRemover.
23 24 25 26 |
# File 'lib/capybara/playwright/tmpdir_owner.rb', line 23 def initialize(tmpdir) @pid = Process.pid @tmpdir = tmpdir end |
Instance Method Details
#call(*args) ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'lib/capybara/playwright/tmpdir_owner.rb', line 28 def call(*args) return if @pid != Process.pid begin FileUtils.remove_entry(@tmpdir, true) rescue => err $stderr.puts err end end |