memfs icon indicating copy to clipboard operation
memfs copied to clipboard

Missing Dir.mktmpdir

Open djberg96 opened this issue 3 years ago • 1 comments

The tmpdir library in the stdlib implements a single method called mktmpdir. I'd like to be able to use it for an eloop test that looks something like this:

  require 'tmpdir'
  Dir.chdir(Dir.mktmpdir) do
    File.symlink('eloop0', 'eloop1')
    File.symlink('eloop1', 'eloop0')
    expected = ['./eloop0', './eloop1']

    results = described_class.new(:path => '.', :follow => true).find
    expect(results.sort).to eq(expected)
  end

However, with memfs I'm getting:

undefined method 'mktmpdir' for MemFs::Dir:Class

Can that be implemented?

djberg96 avatar Apr 17 '22 11:04 djberg96

Hi. Thanks for reporting this issue. Sadly I'm on an extremely tight schedule and can't spend to much time maintaining the project. I'm open to reviewing a PR if you'd like to have a stab at it though 😊

simonc avatar May 03 '22 22:05 simonc