Skip to content

edencehealth/rbasecfg

Repository files navigation

rbasecfg

rbasecfg is an R implementation of the basecfg Python package. It is currently under active development.

Installation

You can install the development version of rbasecfg like so:

devtools::install_github("edencehealth/rbasecfg@v0")

Usage

Here's a basic example of how you can define your application's configuration with rbasecfg:

library(rbasecfg)

MyAppCfg <- R6::R6Class("MyAppCfg",
  inherit = BaseCfg,
  public = list(
    width = opt(default = 10, type = "integer", doc = "the width of a widget"),
    height = opt(default = 20, type = "integer", doc = "the height of a widget"),
    depth = opt(defulat = 30, type = "integer", doc = "the depth of a widget")
  )
)

In your main program:

cfg <- MyAppCfg$new()

At runtime, these variables are automatically populated from the defaults, environment variables, and command-line arguments:

cfg$depth
cfg$height
cfg$width

About

typed 12-factor app configuration helper for R

Resources

License

Stars

Watchers

Forks

Packages

No packages published