End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method
Dir.new
Dir.new( string ) → aDir
Dir.new( string, encoding: enc ) → aDir
dir.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.1.3/dir.rb, line 118
def initialize(name, encoding: nil)
Primitive.dir_initialize(name, encoding)
end
Returns a new directory object for the named directory.
The optional encoding keyword argument specifies the encoding of the directory. If not specified, the filesystem encoding is used.