Skip to content

Commit 060fa34

Browse files
authored
Update Documentation (#12)
* docs: rename authors surname * refactor: rename error for usage clarity, add more detailed error description * refactor: append to last commit * docs: update documentation to most public methods for better understanding and usage * docs: minor text changes in readme * chore: add CHANGELOG.md
1 parent 7390ea4 commit 060fa34

24 files changed

+106
-50
lines changed

CHANGELOG.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
## [1.0.3] - 2021-07-22
8+
9+
### Added
10+
11+
- `CHANGELOG.md` for a better overview regarding all releases.
12+
- Localized error description to error type for more clarity.
13+
14+
### Changed
15+
16+
- Renamed `Error` to `VersionValidationError` for better understanding when parsing an invalid string.
17+
- Updated and enhanced documentation on public methods and properties.
18+
19+
## [1.0.2] - 2021-03-30
20+
21+
Fixed regex pattern for checking if string is alpha numeric or numeric. Removed minor typos and updated documentation.
22+
23+
## [1.0.1] - 2021-03-30
24+
25+
Added missing documentation. Removed redundant methods.
26+
27+
## [1.0.0] - 2021-03-30
28+
29+
Create a version object using a string or from component building a semantic version! You can also use the SemanticVersionComparable protocol to compare to version as much as you like or implement your own version object.
30+
31+
## [0.6.0] - 2021-01-07
32+
33+
Initial published setup of this package. Create a version from string, using major, minor, patch and extensions, from Bundle or from ProcessInfo. Compare two versions with common operators (==, ===, <, <=, >, >=) or get the severity of an update.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021 Marius Hötten-Löns
3+
Copyright (c) 2021 Marius Felkner
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[![doccov](https://mflknr.github.io/SwiftVersionCompare/badge.svg?sanitize=true)](https://mflknr.github.io/SwiftVersionCompare/)
77
[![codecov](https://codecov.io/gh/mflknr/SwiftVersionCompare/branch/develop/graph/badge.svg?token=6EAG2J8DMU)](https://codecov.io/gh/mflknr/SwiftVersionCompare)
88

9-
A small package introducing a `Version` object implementing the `SemanticVersionComparable` protocol for comparing versions conforming to [SemVer](https://semver.org).
9+
A package introducing a `Version` object implementing the `SemanticVersionComparable` protocol for comparing versions conforming to [SemVer](https://semver.org).
1010

1111
# Installation
1212

Sources/SwiftVersionCompare/Helper/Character+Extensions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Character+Extensions.swift
33
// SwiftVersionCompare
44
//
5-
// Created by Marius Hötten-Löns on 30.03.21.
5+
// Created by Marius Felkner on 30.03.21.
66
//
77

88
internal extension Character {

Sources/SwiftVersionCompare/Helper/Error.swift

Lines changed: 0 additions & 10 deletions
This file was deleted.

Sources/SwiftVersionCompare/Helper/String+Regex.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// String+Regex.swift
33
// SwiftVersionCompare
44
//
5-
// Created by Marius Hötten-Löns on 05.01.21.
5+
// Created by Marius Felkner on 05.01.21.
66
//
77

88
internal extension String {

Sources/SwiftVersionCompare/Helper/VersionCompareResult.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
//
2-
// ComparisonResult.swift
2+
// VersionCompareResult.swift
33
// SwiftVersionCompare
44
//
5-
// Created by Marius Hötten-Löns on 06.01.21.
5+
// Created by Marius Felkner on 06.01.21.
66
//
77

88
/// The severity of an update between versions.
99
///
10-
/// - Note: A difference between build-meta-data of versions are explicitly ignored, since `SemVer` does not considere
11-
/// them to be different ranks.
10+
/// - Note: A difference between build-meta-data of versions are as `SemVer` states explicitly ignored.
1211
public enum VersionCompareResult {
1312
/// A `MAJOR`update
1413
case major
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//
2+
// VersionValidationError.swift
3+
// SwiftVersionCompare
4+
//
5+
// Created by Marius Felkner on 29.12.20.
6+
//
7+
8+
import Foundation
9+
10+
enum VersionValidationError: Swift.Error {
11+
case invalidVersionIdentifier(identifier: String)
12+
}
13+
14+
extension VersionValidationError: LocalizedError {
15+
var errorDescription: String? {
16+
switch self {
17+
case .invalidVersionIdentifier(let identifier):
18+
let format = NSLocalizedString(
19+
"The parsed string contained an invalid SemVer version identifier: '%@'.",
20+
comment: ""
21+
)
22+
23+
return String(format: format, identifier)
24+
}
25+
}
26+
}

Sources/SwiftVersionCompare/SemanticVersionComparable/BuildMetaData/BuildMetaData+ExpressibleByLiteral.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// BuildMetaData+ExpressibleByLiteral.swift
33
// SwiftVersionCompare
44
//
5-
// Created by Marius Hötten-Löns on 12.03.21.
5+
// Created by Marius Felkner on 12.03.21.
66
//
77

88
extension BuildMetaData: LosslessStringConvertible {

Sources/SwiftVersionCompare/SemanticVersionComparable/BuildMetaData/BuildMetaData.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
// BuildMetaData.swift
33
// SwiftVersionCompare
44
//
5-
// Created by Marius Hötten-Löns on 12.03.21.
5+
// Created by Marius Felkner on 12.03.21.
66
//
77

8-
/// Typed build-meta-data.
8+
/// Enumerated build-meta-data for simple and `SemVer` conform access.
99
///
1010
/// - Note: Identifier can be described using alphanumeric letters or digits.
1111
///

0 commit comments

Comments
 (0)