touch: Touch a Module.

View source: R/make.R

touchR Documentation

Touch a Module.

Description

Touch a module by marking it as outdated and by resetting its default configuration, if appropriate.

Usage

touch(name = .Last.name)

Arguments

name

A string (character vector of lenght one).

A module name can contain letters, figures and some special characters, namely _, -, and /. The latter is a namespace separator.

Names containing /mock/, /mocks/, /test/, /tests/, /example/, or /examples/ have a special meaning related to code testing and examples.

The name "modulr" corresponds to a special module and is therefore reserved.

Details

See make and module_options.

Warning

It is considered a very bad practice to define, touch, undefine, load, make, reset, or perform any other operation from within a module definition that may alterate the internal state of modulr.

See Also

.Last.name, plot_dependencies, make, module_options, and reset.

Examples

reset()
define("foo", NULL, function() format(Sys.time(), "%H:%M:%OS6"))
make()
make()
touch()
make()

reset()
define("A", NULL, function() "(A)")
define("B", NULL, function() "(B)")
define("C", list(a = "A"), function(a) paste0("(", a, "C)"))
define("D", list(a = "A", b = "B"), function(a, b) paste0("(", a, b, "D)"))
define("E", list(d = "D"), function(d) paste0("(", d, "E)"))
define("F", list(c = "C", d = "D", e = "E"),
  function(c, d, e) paste0("(", c, d, e, "F)"))
make()
touch("B")
make("F")
plot_dependencies()

reset()
define("foo", list(bar = "bar"), function(bar) bar)
define("bar#1.0.0", NULL, function() "bar v1.0.0")
define("bar#1.0.1", NULL, function() "bar v1.0.1")
make("foo")
maps_config$set(foo = list("bar" = "bar#1.0.0"))
make("foo")
touch("foo")
make("foo")


aclemen1/modulr documentation built on Oct. 2, 2024, 7:18 a.m.