Class Source

pkgxx/source.moon

Constructors

Source (arg) Source

Empty constructor.

Attributes can be set by passing them through arg. Example below.

Source
  protocol: "git"
  filename: "local_name"
  url: "https://github.com/Lukc/pkgxx"
Arguments
ArgumentTypeDescription
argtableTable of named parameters.
Return values
TypeDescription
Source

Source.fromString (string) Source

Parses a URL string and converts it into a Source.

Arguments
ArgumentTypeDescription
stringstringInput string to parse.
Return values
TypeDescription
Source

Source.fromVariable (variable) Source

Converts a Lua variable into a Source.

  • Parses it if it’s a string.
  • Returns an empty array if it’s nil.
  • Will try to parse it as an array of strings otherwise. Things will probably go wrong at this point, however.
Arguments
ArgumentTypeDescription
variableobjectInput value to convert.
Return values
TypeDescription
Source

Instance

__tostring ! object

Sources can be safely converted to debug strings that will show @{protocol}, @{url} and @{filename}.


download (context) object

Downloads a source.

Access to a @{Context} is needed to obtain pkg++ modules and downloader backends, as well as the configuration of which directories should store the sources.

Arguments
ArgumentTypeDescription
contextContextContext to use to access backends and configuration.