Dir

ruby/spec describes 39 methods in core/dir, and Metorex implements 36 of them. The parameters are what Method#parameters answers under Metorex.

  • Dir.[]: implemented, parameters [[:req, :args]]. Calls Dir.glob with argument patterns and the values of keyword arguments base and sort; returns the array of selected entry names.
  • Dir#chdir: implemented, parameters [[:block, :block]]. Changes the current working directory to self: An example calling it.
  • Dir.chdir: implemented, parameters [[:req, :args]]. Changes the current working directory. An example calling it.
  • Dir#children: implemented, parameters []. Returns an array of the entry names in self except for '.' and '..': An example calling it.
  • Dir.children: implemented, parameters [[:req, :args]]. Returns an array of the entry names in the directory at dirpath except for '.' and '..'; sets the given encoding onto each returned entry name: An example calling it.
  • Dir.chroot: implemented, parameters [[:req, :args]]. Changes the root directory of the calling process to that specified in dirpath.
  • Dir#close: implemented, parameters []. Closes the stream in self, if it is open, and returns nil; ignored if self is already closed: An example calling it.
  • Dir.delete: implemented, parameters [[:req, :args]]. Removes the directory at dirpath from the underlying file system: An example calling it.
  • Dir#each: implemented, parameters [[:block, :block]]. Calls the block with each entry name in self: An example calling it.
  • Dir#each_child: implemented, parameters [[:block, :block]]. Calls the block with each entry name in self except '.' and '..': An example calling it.
  • Dir.each_child: implemented, parameters [[:req, :args]]. Like Dir.foreach, except that entries '.' and '..' are not included. An example calling it.
  • Dir.empty?: implemented, parameters [[:req, :args]]. Returns whether dirpath specifies an empty directory: An example calling it.
  • Dir.entries: implemented, parameters [[:rest]]. Returns an array of the entry names in the directory at dirpath; sets the given encoding onto each returned entry name: An example calling it.
  • Dir.exist?: implemented, parameters [[:req, :args]]. Returns whether dirpath is a directory in the underlying file system: An example calling it.
  • Dir.exists?: not implemented.
  • Dir.fchdir: implemented, parameters [[:req, :number]]. Changes the current working directory to the directory specified by the integer file descriptor fd.
  • Dir#fileno: implemented, parameters []. Returns the file descriptor used in dir. An example calling it.
  • Dir.for_fd: implemented, parameters [[:req, :number]]. Returns a new Dir object representing the directory specified by the given integer directory file descriptor fd: An example calling it.
  • Dir.foreach: implemented, parameters [[:req, :args]]. Calls the block with each entry name in the directory at dirpath; sets the given encoding onto each passed entry_name: An example calling it.
  • Dir.getwd: implemented, parameters [[:req, :args]]. Returns the path to the current working directory:
  • Dir.glob: implemented, parameters [[:req, :args]]. Forms an array entry_names of the entry names selected by the arguments. An example calling it.
  • Dir.home: implemented, parameters [[:req, :args]]. Returns the home directory path of the user specified with user_name if it is not nil, or the current login user: An example calling it.
  • Dir#initialize: implemented, parameters [[:req, :path], [:keyrest, :options]]. An example calling it.
  • Dir#inspect: implemented, parameters []. Returns a string description of self: An example calling it.
  • Dir.mkdir: implemented, parameters [[:req, :args]]. Creates a directory in the underlying file system at dirpath with the given permissions; returns zero: An example calling it.
  • Dir.open: implemented, parameters [[:req, :path], [:keyrest, :options], [:block, :block]]. Creates a new Dir object dir for the directory at dirpath. An example calling it.
  • Dir#path: implemented, parameters []. Returns the dirpath string that was used to create self (or nil if created by method Dir.for_fd): An example calling it.
  • Dir#pos: implemented, parameters []. Returns the current position of self; see Dir As Stream-Like: An example calling it.
  • Dir#pos=: implemented, parameters [[:req, :position]]. Sets the position in self and returns position.
  • Dir.pwd: implemented, parameters [[:req, :args]]. Returns the path to the current working directory: An example calling it.
  • Dir#read: implemented, parameters []. Reads and returns the next entry name from self; returns nil if at end-of-stream; see Dir As Stream-Like: An example calling it.
  • Dir#rewind: implemented, parameters []. Sets the position in self to zero; see Dir As Stream-Like: An example calling it.
  • Dir.rmdir: implemented, parameters [[:req, :args]]. Removes the directory at dirpath from the underlying file system: An example calling it.
  • Dir#scan: not implemented. An example calling it.
  • Dir.scan: not implemented.
  • Dir#seek: implemented, parameters [[:req, :position]]. Sets the position in self and returns self. An example calling it.
  • Dir#tell: implemented, parameters []. Returns the current position of self; see Dir As Stream-Like: An example calling it.
  • Dir#to_path: implemented, parameters []. Returns the dirpath string that was used to create self (or nil if created by method Dir.for_fd): An example calling it.
  • Dir.unlink: implemented, parameters [[:req, :args]]. Removes the directory at dirpath from the underlying file system: An example calling it.

The method summaries are the first sentences of Ruby's own documentation for each method, read from MRI 4.0.6's ri data. Ruby's documentation is distributed under Ruby's license.