public static function loadPatternsInPath($path)
    {
        $groups = array();

        if ($handle = opendir($path)) {

            while (false !== ($entry = readdir($handle))) {
                
                $fullPath = $path . '/' . $entry;

                if (substr($entry, 0, 1) !== '.') {

                    $id = trim(str_replace(Primer::$PATTERN_PATH, '', $fullPath), '/');

                    // Load the pattern
                    $groups[] = new Group($id);
                }
            }

            closedir($handle);
        }

        return $groups;
    }