set_version: Set version field

Description Usage Arguments Value Examples

View source: R/set_version.R

Description

Set the version field. "Major", "minor" and "patch" fields are set as integers, "prerelease" and "build" are set with character strings.

Usage

1
2
3
4
5
6
7
8
set_version(x, field, value, ...)

## S3 method for class 'svptr'
set_version(x, field = c("major", "minor", "patch",
  "prerelease", "build"), value, ...)

## S3 method for class 'svlist'
set_version(x, field, value, ...)

Arguments

x

An object of class "svlist" or "svptr".

field

For the "svptr" class a character string detailing the field to set (major, minor etc...). For the "svlist" class a character vector detailing the field to set for each list member.

value

The value to set the field to. For fields "major", "minor" and "patch" this is an integer. For fields "prerelease" and "build" this is a character. For the "svptr" class value is a scalar. For the "svlist" class value is a list detailing the value to set for each list member.

...

Additional arguments passed on to methods.

Value

returns an object of class svptr or svlist

Examples

1
2
3
4
semver <- parse_version(c("1.2.3", "1.2.4-alpha+bld1"))
semver[[1]] <- set_version(semver[[1]], "major", 2L)
set_version(semver, c("prerelease", "build"), list("hello"))
set_version(semver, c("prerelease"), list("hello", "world"))

semver documentation built on May 2, 2019, 5:53 a.m.