struct Pathname
- Pathname
- Struct
- Value
- Object
Included Modules
- Comparable(Pathname)
Defined in:
pathname.crConstant Summary
-
VERSION =
"0.1.6"
Constructors
Class Method Summary
- .cwd
- .glob(patterns : Enumerable(String), &)
- .glob(*patterns, &)
- .glob(patterns : Enumerable(String))
- .glob(*patterns)
Instance Method Summary
- #+(other : Pathname) : Pathname
- #+(other : String) : Pathname
- #/(other : Pathname) : Pathname
- #/(other : String) : Pathname
-
#<=>(other : Pathname)
The comparison operator.
- #===(other : Pathname)
- #absolute? : Bool
- #ascend(&)
- #atime : Time
- #basename(suffix : String) : Pathname
- #basename : Pathname
- #blockdev? : Bool
- #chardev? : Bool
- #children(with_directory : Bool = true) : Array(Pathname)
- #cleanpath(consider_symlink : Bool = false) : Pathname
- #ctime : Time
- #delete
- #descend(&)
- #directory? : Bool
- #dirname : Pathname
- #each_child(with_directory : Bool = true, &)
- #each_entry(&)
- #each_filename(&)
- #each_line(&)
- #entries : StaticArray(Array, Pathname)
- #executable? : Bool
- #exists? : Bool
- #expand_path(default_dir : Pathname) : Pathname
- #expand_path(default_dir : String = Dir.current)
- #extname : String
- #file? : Bool
- #filenames : Array(String)
- #inspect(io)
- #join(*args) : Pathname
- #lstat
- #make_link(old)
- #make_symlink(old)
- #mkdir(mode = 329)
- #mkdir_p(mode = 329)
- #mtime : Time
- #open(mode = "r", perm = DEFAULT_CREATE_MODE)
- #open(mode = "r", perm = DEFAULT_CREATE_MODE, &)
- #opendir
- #opendir(&)
- #parent
- #read(encoding = nil, invalid = nil) : String
- #readable? : Bool
- #real_path : Pathname
- #relative? : Bool
- #relative_path_from(base_directory : String) : Pathname
- #relative_path_from(base_directory : Pathname) : Pathname
- #rename(to)
- #rmdir
- #root?
- #setgid?
- #setuid?
- #size
- #size?
- #socket?
- #split
- #stat
- #sticky?
- #sub(pattern, replace) : Pathname
- #sub(pattern, &)
- #sub_ext(replace : String)
- #symlink?
- #to_s(io)
- #truncate(size = 0)
- #utime
- #world_readable?
- #world_writable?
- #writable?
- #write(content, perm = DEFAULT_CREATE_MODE, encoding = nil, invalid = nil)
- #zero?
Constructor Detail
Class Method Detail
Instance Method Detail
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]