struct

Fluxion::Registry::Source

Inherits Struct < Value < Object

A registry the user has configured.

Two locations, deliberately separate:

  • The mirror, a git clone under the cache directory. It is disposable โ€” deleting it costs a re-clone and nothing else.
  • The installed directory under the config directory, holding the configurations the user actually chose. That is theirs: sync never overwrites it without being asked.

Keeping them apart is what makes "installed" mean something. If the clone were the install destination, every sync would silently change files the user had edited.

Constants

NAME_PATTERN = /\A[A-Za-z0-9](?:[A-Za-z0-9._-]*[A-Za-z0-9])?\z/

Names become directory names, so they are constrained rather than escaped.

Constructors

new(name : String, url : String, ref : String | Nil = nil, default : Bool = false)
Source

Class methods

derive_name(url : String) : String | Nil

Derives a name from a repository URL: the last path segment, minus .git.

https://github.com/worxbend/fluxion-profiles.git  ->  fluxion-profiles
git@github.com:worxbend/fluxion-profiles          ->  fluxion-profiles
Source
install_root
Source
mirror_root
Source
settings_path
Source
valid_name?(name : String) : Bool
Source
validate_url(url : String) : String | Nil

Accepted transports.

A registry decides what a machine will be told to install, so it has to come over something authenticated. file: is allowed because a local registry is genuinely useful โ€” for testing, and for a private one on a shared filesystem โ€” and it is not reachable by anyone who is not already on the machine.

Source

Instance methods

cloned?
Source
default?
Source
install_path

Where installed configurations land.

Source
manifest_path
Source
mirror_path

Where the git mirror lives. Under the cache directory because it is reconstructible from the URL alone.

Source
name

github.com/worxbend/x and git@github.com:worxbend/x.git are the same registry, so the name is derived from the repository rather than the URL.

Source
ref

Branch or tag to track. Nil follows the repository's default branch.

Source
to_s(io : IO) : Nil

Same as #inspect(io).

Source