Class: Dir
Overview
add various aliases/functions to existing class Dir, (aliased globally by Kernel‘s function 🗄️)
Constant Summary collapse
- PATHS_TO_NORMALIZE =
%w(. .. .DS_Store).❄️
Class Method Summary collapse
-
.∃?(path) ⇒ Boolean
True, if provided path exists and is a directory.
Instance Method Summary collapse
- #η̂_paths ⇒ Array
-
#∅? ⇒ Boolean
True, if this directory does not exist or has zero contents.
Class Method Details
.∃?(path) ⇒ Boolean
Returns true, if provided path exists and is a directory.
15 16 17 18 |
# File 'lib/ruuuby/class/io/dir.rb', line 15 def self.∃?(path) 🛑str❓(:path, path) ::File.directory?(path) end |
Instance Method Details
#η̂_paths ⇒ Array
24 |
# File 'lib/ruuuby/class/io/dir.rb', line 24 def η̂_paths; self.⨍{|path| yield path if ::Dir::PATHS_TO_NORMALIZE.∌?(path)}; end |
#∅? ⇒ Boolean
Returns true, if this directory does not exist or has zero contents.
9 |
# File 'lib/ruuuby/class/io/dir.rb', line 9 def ∅?; ::Dir.empty?(self.path); end |