Module: Recls::Ximpl::OS

Defined in:
lib/recls/ximpl/os.rb

Overview

:nodoc: all

Constant Summary collapse

OS_IS_WINDOWS =
(RUBY_PLATFORM =~ /(mswin|mingw|bccwin|wince)/i) ? true : false
PATH_NAME_SEPARATOR =
OS_IS_WINDOWS ? '\\' : '/'
PATH_SEPARATOR =
OS_IS_WINDOWS ? ';' : ':'
WILDCARDS_ALL =
OS_IS_WINDOWS ? '*' : '*'

Class Method Summary collapse

Class Method Details

.get_number_of_dots_dir_(p) ⇒ Object



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/recls/ximpl/os.rb', line 57

def OS.get_number_of_dots_dir_(p)

  if p
    if ?. == p[0]
      return 1 if 1 == p.size
      return 1 if ?/ == p[1]
      return 1 if OS_IS_WINDOWS and ?\\ == p[1]
      if ?. == p[1]
        return 2 if 2 == p.size
        return 2 if ?/ == p[2]
        return 2 if OS_IS_WINDOWS and ?\\ == p[2]
      end
    end
  end

  return 0
end

.is_root_dir_(p) ⇒ Object



75
76
77
78
79
80
81
82
# File 'lib/recls/ximpl/os.rb', line 75

def OS.is_root_dir_(p)

  return nil if not p
  return true if '/' == p
  return true if OS_IS_WINDOWS and '\\' == p

  return false
end