Class: Commons::IO::FilenameUtils
- Inherits:
-
Object
- Object
- Commons::IO::FilenameUtils
- Defined in:
- lib/commons/io/filename_utils.rb
Overview
This class contains utility methods for file name string.
Class Method Summary collapse
-
.absolute?(path) ⇒ Boolean
Test whether the given path string is absolute path or not.
Instance Method Summary collapse
-
#initialize ⇒ FilenameUtils
constructor
A new instance of FilenameUtils.
Constructor Details
#initialize ⇒ FilenameUtils
Returns a new instance of FilenameUtils.
40 41 42 |
# File 'lib/commons/io/filename_utils.rb', line 40 def initialize super() end |
Class Method Details
.absolute?(path) ⇒ Boolean
Test whether the given path string is absolute path or not.
46 47 48 49 50 |
# File 'lib/commons/io/filename_utils.rb', line 46 def self.absolute?(path) return true if path =~ /^(?:\w:)?(?:\/|\\)/ return true if path[0].chr == '/' return false end |