Like `Dir.glob`, but works with backslash-separated paths on Windows.

 @param path [String]
766043
def glob(path)
      path = path.tr('\\', '/') if windows?
      if block_given?
        Dir.glob(path) {|f| yield(f)}
      else
        Dir.glob(path)
      end
    end
989444
def CheckDirectory(self, path, extension='yaml'):
    
    result = True

    if extension:
      glob_spec = os.path.join(path, '*.{0:s}'.format(extension))
    else:
      glob_spec = os.path.join(path, '*')

    for definition_file in sorted(glob.glob(glob_spec)):
      if not self.CheckFile(definition_file):
        result = False

    return result
149962
function (path) {
        if (_.isArray(path)) {
            return path;
        } else if (_.isString(path)) {
            return path.split('.');
        }
    }
818743
def format_paths(paths, filepath)
      # Extract included paths
      paths
        .map { |path| File.join(File.dirname(filepath), path) }
        .map { |path| File.expand_path(path) }
        .select { |path| File.exist?(path) || Dir.exist?(path) }
    end
413009
def set_root_path!
       raise 'APP_ROOT is not set' unless defined?(::APP_ROOT)
       raise 'APP_ROOT is not a directory' unless File.directory?(::APP_ROOT)

       @root_path =
         # Pathname is incompatible with Windows, but Windows doesn't have
         # real symlinks so File.expand_path is safe.
         if RUBY_PLATFORM =~ /(:?mswin|mingw)/
           File.expand_path(::APP_ROOT)

         # Otherwise use Pathname#realpath which respects symlinks.
         else
           Pathname.new(::APP_ROOT).realpath.to_s
         end

       Object.const_set(:RELATIVE_APP_ROOT, ::APP_ROOT.dup) unless defined?(::RELATIVE_APP_ROOT)
       ::APP_ROOT.replace @root_path
     end
913834
def _valid_directory(self, path):
        
        abspath = os.path.abspath(path)
        if not os.path.isdir(abspath):
            raise argparse.ArgumentTypeError('Not a valid directory: {}'.format(abspath))
        return abspath
1127466
def <<( str )
      path = Pathname( str )

      case
      when !path.exist?
        raise Errno::ENOENT, path.to_path
      when !path.directory?
        raise Errno::ENOTDIR, path.to_path
      else
        super path.expand_path
      end
    end
1261954
def relative_to_local_path(path)
      if path && path.length > 0
        case_insensitive_join(local_path, path)
      else
        case_insensitive_resolve(local_path)
      end
    end
1170808
def normalize_path(path)
      if path.is_a?(String)
        path.split(':')
      elsif path.respond_to?(:each)
        path
      else
        [path]
      end
    end
1195846
def target_path(path)
      parts = File.basename(path.to_s).split(".")
      path = path.to_s

      # Always return .html directly as it will cause too much trouble otherwise
      return Pathname.new(path) if parts.last == "html"

      target_ext = Roger::Renderer.target_extension_for(path)
      source_ext = Roger::Renderer.source_extension_for(path)

      # If there is no target extension
      return Pathname.new(path) if target_ext.empty?

      # If we have at least one extension
      if parts.size > 1
        source_ext_regexp = /#{Regexp.escape(source_ext)}\Z/
        Pathname.new(path.gsub(source_ext_regexp, target_ext))
      else
        Pathname.new(path + "." + target_ext)
      end
    end
1322290
def _glob_escape(pathname):
    
    drive, pathname = os.path.splitdrive(pathname)
    pathname = _magic_check.sub(r'[\1]', pathname)
    return drive + pathname
419612
def mkdir(self, path):
        
        if not os.path.exists(path):
            os.makedirs(path)
1202324
def require_files(glob, root_path = app_root_path)
      Pathname.glob(root_path.join(glob)).each do |filename|
        require filename.expand_path
      end
    end
1210781
def to_path_globs(self, relpath, conjunction):
    """"""
    return PathGlobs(
      include=tuple(os.path.join(relpath, glob) for glob in self._file_globs),
      exclude=tuple(os.path.join(relpath, exclude) for exclude in self._excluded_file_globs),
      conjunction=conjunction)
1085244
def generic_filename(path):
    '''
    
    '''

    for sep in common_path_separators:
        if sep in path:
            _, path = path.rsplit(sep, 1)
    return path
1140692
def split_path(path)
      splitted = path.split(SLASH)
      splitted << EMPTY_STR if path.end_with? SLASH
      splitted
    end
1010646
def pyfile_path(path):
    
    if "/" in path:
        parts = path.split("/")
        join_term = "/"
    elif "\\" in path:
        parts =path.split("\\")
        join_term = "\\"
    parts.reverse()
    base = parts[:parts.index('rdfframework')]
    base.reverse()
    return join_term.join(base)