These functions allows to update the components of version objects.
increment_major()
,increment_minor()
, andincrement_patch()
update the major, minor, and patch version numbers respectively.mark_as_pre_release()
marks the version as a pre-release version.add_build_metadata()
adds build metadata to the version.
Usage
increment_major(x, ...)
# S3 method for class 'smvr'
increment_major(x, ...)
increment_minor(x, ...)
# S3 method for class 'smvr'
increment_minor(x, ...)
increment_patch(x, ...)
# S3 method for class 'smvr'
increment_patch(x, ...)
mark_as_pre_release(x, ...)
# S3 method for class 'smvr'
mark_as_pre_release(x, ids = "pre", ...)
add_build_metadata(x, ...)
# S3 method for class 'smvr'
add_build_metadata(x, metadata = "", ...)
Examples
v <- parse_semver(c("0.9.9", "1.0.0-a.1", "1.1.0+1"))
increment_major(v)
#> <smvr[3]>
#> [1] 1.0.0 2.0.0 2.0.0
increment_minor(v)
#> <smvr[3]>
#> [1] 0.10.0 1.1.0 1.2.0
increment_patch(v)
#> <smvr[3]>
#> [1] 0.9.10 1.0.1 1.1.1
mark_as_pre_release(v, ids = c("pre.1"))
#> <smvr[3]>
#> [1] 0.9.9-pre.1 1.0.0-pre.1 1.1.0-pre.1+1
add_build_metadata(v, metadata = "build.1")
#> <smvr[3]>
#> [1] 0.9.9+build.1 1.0.0-a.1+build.1 1.1.0+build.1