struct

CRDoc::Shards::Spec

Inherits Struct < Value < Object

A parsed add argument: a git remote (with optional ref) or a local directory.

Constants

HOSTED_PATTERN = /\A(github|gitlab|codeberg):([\w.\-]+)\/([\w.\-]+?)(?:\.git)?(?:@(\S+))?\z/
HOSTS = {"github" => "github.com", "gitlab" => "gitlab.com", "codeberg" => "codeberg.org"}
URL_REF_PATTERN = /\A(.+?)@([^@\/:\s]+)\z/

A trailing @ref. The ref has no / or :, so the @ in git@host:path and user@host/path never matches.

Constructors

new(kind : CRDoc::Shards::Spec::Kind, location : String, ref : Nil | String = nil)
Source
parse(text : String) : Spec
Source

Instance methods

kind
Source
location

Clone URL for git specs, absolute directory for local specs.

Source
to_s(io : IO) : Nil

The spec as recorded in the registry.

Source

Nested types