Class: Commons::IO::FilenameUtils

Inherits:
Object
  • Object
show all
Defined in:
lib/commons/io/filename_utils.rb

Overview

This class contains utility methods for file name string.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFilenameUtils

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.

Returns:

  • (Boolean)


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