class Distribution::Path

Distribution::Path

    class Distribution::Path does Distribution::Locally { }

A Distribution implementation backed by the filesystem. It requires a META6.json file at its root.

Methods

method new

method new(IO::Path $prefixIO::Path :$meta-file = IO::Path)

Creates a new Distribution::Path instance from the META6.json file found at the given $prefix, and from which all paths in the metadata will be prefixed with. :$meta-file may optionally be passed if a filename other than META6.json needs to be used.

method meta

method meta()

Returns a Hash with the representation of the metadata.

method content

Distribution::Locally#method_content

Returns an IO::Handle to the file represented by $name-path. $name-path is a relative path as it would be found in the metadata such as lib/Foo.pm6 or resources/foo.txt.

Type Graph

Type relations for Distribution::Path
perl6-type-graph Distribution::Path Distribution::Path Any Any Distribution::Path->Any Distribution::Locally Distribution::Locally Distribution::Path->Distribution::Locally Mu Mu Any->Mu Distribution Distribution Distribution::Locally->Distribution

Expand above chart

Routines supplied by role Distribution::Locally

Distribution::Path does role Distribution::Locally, which provides the following routines:

(Distribution::Locally) method prefix

A prefix path to be used in conjuncture with the paths found in the metadata.

(Distribution::Locally) method content

Provides Distribution#method_content

Returns an IO::Handle to the file represented by $name-path. $name-path is a relative path as it would be found in the metadata such as lib/Foo.pm6 or resources/foo.txt, and these paths will be prefixed with Distribution#method_prefix.

Routines supplied by role Distribution

Distribution::Path does role Distribution, which provides the following routines:

(Distribution) method meta

method meta(--> Hash:D{ ... }

Returns a Hash with the representation of the metadata. Please note that an actual META6.json file does not need to exist, just a representation in that format.

(Distribution) method content

method content($name-path --> IO::Handle:D{ ... }

Returns an IO::Handle to the file represented by $name-path. $name-path is a relative path as it would be found in the metadata such as lib/Foo.pm6 or resources/foo.txt.