Class FakeFS::Pathname
In: lib/fakefs/pathname.rb
Parent: Object

Pathname class

Methods

atime   basename   binread   blockdev?   chardev?   chmod   chown   ctime   delete   directory?   dirname   each_entry   each_line   entries   executable?   executable_real?   exist?   expand_path   extname   file?   find   fnmatch   fnmatch?   ftype   getwd   glob   grpowned?   lchmod   lchown   lstat   make_link   make_symlink   mkdir   mkpath   mtime   open   opendir   owned?   pipe?   read   readable?   readable_real?   readlines   readlink   rename   rmdir   rmtree   setgid?   setuid?   size   size?   socket?   split   stat   sticky?   symlink?   sysopen   truncate   unlink   utime   world_readable?   world_writable?   writable?   writable_real?   zero?  

Constants

TO_PATH = :to_path   to_path is implemented so Pathname objects are usable with File.open, etc.
SAME_PATHS = if File::FNM_SYSCASE.nonzero?

External Aliases

getwd -> pwd

Public Class methods

See Dir.getwd. Returns the current working directory as a Pathname.

See Dir.glob. Returns or yields Pathname objects.

Public Instance methods

See File.atime. Returns last access time.

See File.basename. Returns the last component of the path.

See IO.binread. Returns all the bytes from the file, or the first N if specified.

See FileTest.blockdev?.

See FileTest.chardev?.

See File.chmod. Changes permissions.

See File.chown. Change owner and group of file.

See File.ctime. Returns last (directory entry, not file) change time.

delete()

Alias for unlink

See FileTest.directory?.

See File.dirname. Returns all but the last component of the path.

Iterates over the entries (files and subdirectories) in the directory. It yields a Pathname object for each entry.

This method has existed since 1.8.1.

each_line iterates over the line in the file. It yields a String object for each line.

This method has existed since 1.8.1.

Return the entries (files and subdirectories) in the directory, each as a Pathname object.

See FileTest.executable?.

See FileTest.executable_real?.

See FileTest.exist?.

See File.extname. Returns the file‘s extension.

See FileTest.file?.

Pathname#find is an iterator to traverse a directory tree in a depth first manner. It yields a Pathname for each file under "this" directory.

Since it is implemented by find.rb, Find.prune can be used to control the traverse.

If self is ., yielded pathnames begin with a filename in the current directory, not ./.

See File.fnmatch. Return true if the receiver matches the given pattern

See File.fnmatch? (same as fnmatch).

See File.ftype. Returns "type" of file ("file", "directory", etc).

See FileTest.grpowned?.

See File.lchmod.

See File.lchown.

See File.link. Creates a hard link.

See File.symlink. Creates a symbolic link.

See Dir.mkdir. Create the referenced directory.

See FileUtils.mkpath. Creates a full path, including any intermediate directories that don‘t yet exist.

See File.mtime. Returns last modification time.

See File.open. Opens the file for reading or writing.

See FileTest.owned?.

See FileTest.pipe?.

See IO.read. Returns all data from the file, or the first N bytes if specified.

See FileTest.readable?.

See FileTest.readable_real?.

See IO.readlines. Returns all the lines from the file.

See File.readlink. Read symbolic link.

See File.rename. Rename the file.

See Dir.rmdir. Remove the referenced directory.

See FileUtils.rm_r. Deletes a directory and all beneath it.

See FileTest.setgid?.

See FileTest.setuid?.

See FileTest.size.

See FileTest.size?.

See FileTest.socket?.

See File.split. Returns the dirname and the basename in an Array.

See File.stat. Returns a File::Stat object.

See FileTest.sticky?.

See FileTest.symlink?.

See IO.sysopen. Not supported by fakefs.

See File.truncate. Truncate the file to length bytes.

Removes a file or directory, using File.unlink or Dir.unlink as necessary.

See File.utime. Update the access and modification times.

See FileTest.world_readable?.

See FileTest.world_writable?.

See FileTest.writable?.

See FileTest.writable_real?.

See FileTest.zero?.

[Validate]