lucee.Componentcommandbox.system.modules.semver.models.SemanticVersion
Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp www.coldbox.org | www.luismajano.com | www.ortussolutions.com Utility to parse and validate semantic versions Semantic version: major.minor.revision-preReleaseID+build http://semver.org/ https://github.com/npm/node-semver
Constructor Summary | |
---|---|
init()
Constructor. |
Method Summary | |
---|---|
private any
|
buildComparatorSet(string set)
|
private any
|
buildRange(string range)
|
string
|
clean(any version)
Clean a version string from leading = or v. |
any
|
compare(string current, string target, [boolean checkBuildID='true'])
|
private any
|
evaluateComparator(struct comparator, [any version])
|
private any
|
expandXRanges(struct sComparator)
|
any
|
getDefaultsVersion()
|
string
|
getVersionAsString(struct sVersion, [boolean includeBuildID='true'])
Parse the incoming version struct and output it as a string. |
private any
|
interestedInPreReleasesOfThisVersion(array comparatorSet, string version)
|
boolean
|
isEQ(string current, string target, [boolean checkBuildID='true'])
Checks if the versions are equal. |
boolean
|
isExactVersion(string version, [any includeBuildID='false'])
True if a specific version, false if a range that could match multiple versions. |
boolean
|
isNew(string current, string target, [boolean checkBuildID='true'])
Checks if target version is a newer semantic version than the passed current version. |
boolean
|
isPreRelease(string version)
Verifies if the passed version string is in a pre-release state. |
struct
|
parseVersion(string version, [any missingValuePlaceholder])
Parse the semantic version. |
string
|
parseVersionAsString(string version, [boolean includeBuildID='true'])
Parse the incoming version string and conform it to semantic version. |
any
|
preReleaseCompare([any targetPreReleaseID], [any currentPreReleaseID])
|
any
|
preReleaseCompareSegment([any targetPreReleaseID], [any currentPreReleaseID])
|
boolean
|
satisfies(string version, string range)
Decides whether a version satisfies a range. |
Methods inherited from class lucee.Component |
---|
None |
Constructor Detail |
---|
Constructor
Method Detail |
---|
set
range
Clean a version string from leading = or v
version
current
target
checkBuildID
comparator
version
sComparator
Parse the incoming version struct and output it as a string
sVersion
includeBuildID
comparatorSet
version
Checks if the versions are equal current.hint The current version of the system target.hint The target version to check
current
target
checkBuildID
True if a specific version, false if a range that could match multiple versions version.hint A string that contains a version or a range
version
includeBuildID
Checks if target version is a newer semantic version than the passed current version Note: To confirm to semvar, I think this needs to defer to gt().
current
- The current version of the systemtarget
- The newer version receivedcheckBuildID
- If true it will check build equality, else it will ignore itVerifies if the passed version string is in a pre-release state Pre-release is defined by the existance of a preRelease ID
version
Parse the semantic version. If no minor found, then 0. If not revision found, then 0. If not Bleeding Edge bit, then empty. If not buildID, then 0
version
missingValuePlaceholder
Parse the incoming version string and conform it to semantic version. If preReleaseID is not found it is omitted.
version
includeBuildID
targetPreReleaseID
currentPreReleaseID
targetPreReleaseID
currentPreReleaseID
Decides whether a version satisfies a range
version
range