https://ruby-doc.org/stdlib-2.6.3/libdoc/tmpdir/rdoc/Dir.html contains a description about the mktmpdir
method of the Dir class.
mktmpdir(prefix_suffix=nil, *rest)
::mktmpdir creates a temporary directory.
An app uses it with no error but why it is not possible to run it in console / irb?
I have tested with Dir.new ...
as well, below my attempt with Dir.mktmpdir
.
irb(main):010:0> Dir.mktmpdir {|dir| dir is ".../d..." }
Traceback (most recent call last):
5: from C:/Ruby26/bin/irb.cmd:31:in `<main>'
4: from C:/Ruby26/bin/irb.cmd:31:in `load'
3: from C:/Ruby26/lib/ruby/gems/2.6.0/gems/irb-1.0.0/exe/irb:11:in `<top (required)>'
2: from (irb):10
1: from (irb):10:in `rescue in irb_binding'
NoMethodError (undefined method `mktmpdir' for Dir:Class)
Dir.methods
is not showing this method but only mkdir.
What is missing respectively what is the reason for this behavior?