struct Pathname

Included Modules

Defined in:

pathname.cr

Constant Summary

VERSION = "0.1.6"

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(path : String) #

[View source]
def self.new(path : Pathname) #

[View source]

Class Method Detail

def self.cwd #

[View source]
def self.glob(patterns : Enumerable(String), &) #

[View source]
def self.glob(*patterns, &) #

[View source]
def self.glob(patterns : Enumerable(String)) #

[View source]
def self.glob(*patterns) #

[View source]

Instance Method Detail

def +(other : Pathname) : Pathname #

[View source]
def +(other : String) : Pathname #

[View source]
def /(other : Pathname) : Pathname #

[View source]
def /(other : String) : Pathname #

[View source]
def <=>(other : Pathname) #
Description copied from module Comparable(Pathname)

The comparison operator. Returns 0 if the two objects are equal, a negative number if this object is considered less than other, a positive number if this object is considered greater than other, or nil if the two objects are not comparable.

Subclasses define this method to provide class-specific ordering.

The comparison operator is usually used to sort values:

# Sort in a descending way:
[3, 1, 2].sort { |x, y| y <=> x } # => [3, 2, 1]

# Sort in an ascending way:
[3, 1, 2].sort { |x, y| x <=> y } # => [1, 2, 3]

[View source]
def ===(other : Pathname) #

[View source]
def absolute? : Bool #

[View source]
def ascend(&) #

[View source]
def atime : Time #

[View source]
def basename(suffix : String) : Pathname #

[View source]
def basename : Pathname #

[View source]
def blockdev? : Bool #

[View source]
def chardev? : Bool #

[View source]
def children(with_directory : Bool = true) : Array(Pathname) #

[View source]
def cleanpath(consider_symlink : Bool = false) : Pathname #

[View source]
def ctime : Time #

[View source]
def delete #

[View source]
def descend(&) #

[View source]
def directory? : Bool #

[View source]
def dirname : Pathname #

[View source]
def each_child(with_directory : Bool = true, &) #

[View source]
def each_entry(&) #

[View source]
def each_filename(&) #

[View source]
def each_line(&) #

[View source]
def entries : StaticArray(Array, Pathname) #

[View source]
def executable? : Bool #

[View source]
def exists? : Bool #

[View source]
def expand_path(default_dir : Pathname) : Pathname #

[View source]
def expand_path(default_dir : String = Dir.current) #

[View source]
def extname : String #

[View source]
def file? : Bool #

[View source]
def filenames : Array(String) #

[View source]
def inspect(io) #

[View source]
def join(*args) : Pathname #

[View source]
def lstat #

[View source]
def make_link(old) #

[View source]
def make_symlink(old) #

[View source]
def mkdir(mode = 329) #

[View source]
def mkdir_p(mode = 329) #

[View source]
def mtime : Time #

[View source]
def open(mode = "r", perm = DEFAULT_CREATE_MODE) #

[View source]
def open(mode = "r", perm = DEFAULT_CREATE_MODE, &) #

[View source]
def opendir #

[View source]
def opendir(&) #

[View source]
def parent #

[View source]
def read(encoding = nil, invalid = nil) : String #

[View source]
def readable? : Bool #

[View source]
def real_path : Pathname #

[View source]
def relative? : Bool #

[View source]
def relative_path_from(base_directory : String) : Pathname #

[View source]
def relative_path_from(base_directory : Pathname) : Pathname #

[View source]
def rename(to) #

[View source]
def rmdir #

[View source]
def root? #

[View source]
def setgid? #

[View source]
def setuid? #

[View source]
def size #

[View source]
def size? #

[View source]
def socket? #

[View source]
def split #

[View source]
def stat #

[View source]
def sticky? #

[View source]
def sub(pattern, replace) : Pathname #

[View source]
def sub(pattern, &) #

[View source]
def sub_ext(replace : String) #

[View source]
def symlink? #

[View source]
def to_s(io) #

[View source]
def truncate(size = 0) #

[View source]
def utime #

[View source]
def world_readable? #

[View source]
def world_writable? #

[View source]
def writable? #

[View source]
def write(content, perm = DEFAULT_CREATE_MODE, encoding = nil, invalid = nil) #

[View source]
def zero? #

[View source]