Learn R Programming

mighty.component (version 0.2.0)

mighty_repo: Component repos

Description

  • mighty_repo(): Create a component repo from a spec.

  • mighty_repo_class: Abstract parent class of all component repos. It has no properties and cannot be created directly.

Specs have the form type::path. Supported types:

  • local: A local directory, e.g. local::inst/examples. A spec without a prefix is treated as local.

  • github: A GitHub repository, e.g. github::owner/repo/subdir@ref. See mighty_repo_github().

  • url: Raw files under a base URL, e.g. url::https://example.com/components. See mighty_repo_url().

All repo types share one layout. A component name is the file <name>.R or <name>.mustache, either directly in the repo or in a directory named after the component (<name>/<name>.R). A name with an extension only matches that file.

Usage

mighty_repo(spec)

Value

mighty_repo(): An object inheriting from mighty_repo_class.

Arguments

spec

character(1) repo spec. See description.

See Also

mighty_repo_local(), mighty_repo_github(), mighty_repo_url(), mighty_repos()

Examples

Run this code
path <- system.file("examples", package = "mighty.component")
mighty_repo(path)
mighty_repo(paste0("local::", path))

Run the code above in your browser using DataLab