-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* docs: fill readme * feat: add jazzy file * chore: make protocol public * docs: add auto generated jazzy docs * chore: update readme * chore: fix readme code blocks
- Loading branch information
Showing
56 changed files
with
10,055 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module: SwiftVersionCompare | ||
author: nihilias | ||
author_url: https://www.nihilias.de/ | ||
github_url: https://github.com/nihilias/SwiftVersionCompare/ | ||
readme: README.md | ||
skip_undocumented: true | ||
hide_documentation_coverage: false | ||
theme: apple | ||
output: docs/ | ||
swift_version: 5.3.1 | ||
clean: true | ||
min_acl: public | ||
xcodebuild_arguments: | ||
- -project | ||
- SwiftVersionCompare.xcodeproj | ||
- -scheme | ||
- SwiftVersionCompare-Package | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,58 @@ | ||
# SwiftVersionCheck | ||
# SwiftVersionCheck | ||
|
||
A small package for comparing and using versions conforming to [SemVer](https://semver.org). | ||
|
||
Following features are and will be implemented: | ||
|
||
- [x] Create a version from major, minor, patch and extension information. | ||
- [x] Create a version from string using `LosslessStringConvertible` or `ExpressibleByStringLiteral` . | ||
- [x] Compare versions using `Equatable` and `Comparable` with the known operators `==, ===, <, <=, > and >=`. | ||
- [x] Compare versions and get a result type defining the severity of the version difference (e. g. major-update). | ||
- [ ] Utilize ranges for a greater variaty of comparisons. | ||
- [x] Extend `Bundle` and `ProcessInfo` for easy usage. | ||
- [x] Open documentation. | ||
- [ ] Implement extension for `Codable` and `Hashable`. | ||
|
||
# Installation | ||
|
||
Swift Package Manager: | ||
|
||
```swift | ||
package(url: https://github.com/nihilias/SwiftVersionCompare.git", from: "1.0.0")) | ||
``` | ||
|
||
# Usage | ||
|
||
For detailed implenentation information see auto-generated [documentation](). | ||
|
||
```swift | ||
// use the version identifier for initialization | ||
let versionOne = Version(1, 0, 0) | ||
let versionTwo = Version( | ||
major: 1, | ||
minor: 0, | ||
patch: 0 | ||
) | ||
|
||
// use strings | ||
// use `ExpressibleByStringLiteral` with caution, because it's fatal if string is not `SemVer` version | ||
let versionThreeA: Version = "1.0.0" | ||
let versionThreeB: Version = Version("1.0.0") | ||
|
||
let versionFourA: Version? = "1.0.0" | ||
let versionFourB: Version? = Version("1.0.0") | ||
|
||
// easy initial `0.0.0` version | ||
let initialVersion: Version = .initial | ||
|
||
// from bundle and processInfo | ||
let bundleVersion = Bundle.main.shortVersion | ||
let osVersion = ProcessInfo.processInfo.comparableOperatingSystemVersion | ||
|
||
// compare versions with usally known operators (==, ===, <, <=, >=, >) | ||
if Version("1.0.0") > Version("0.4.0") { | ||
// ... | ||
} | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<title>Enumerations Reference</title> | ||
<link rel="stylesheet" type="text/css" href="css/jazzy.css" /> | ||
<link rel="stylesheet" type="text/css" href="css/highlight.css" /> | ||
<meta charset='utf-8'> | ||
<script src="js/jquery.min.js" defer></script> | ||
<script src="js/jazzy.js" defer></script> | ||
|
||
<script src="js/lunr.min.js" defer></script> | ||
<script src="js/typeahead.jquery.js" defer></script> | ||
<script src="js/jazzy.search.js" defer></script> | ||
</head> | ||
<body> | ||
<a name="//apple_ref/swift/Section/Enumerations" class="dashAnchor"></a> | ||
<a title="Enumerations Reference"></a> | ||
<header> | ||
<div class="content-wrapper"> | ||
<p><a href="index.html"> Docs</a> (100% documented)</p> | ||
<p class="header-right"> | ||
<form role="search" action="search.json"> | ||
<input type="text" placeholder="Search documentation" data-typeahead> | ||
</form> | ||
</p> | ||
</div> | ||
</header> | ||
<div class="content-wrapper"> | ||
<p id="breadcrumbs"> | ||
<a href="index.html"> Reference</a> | ||
<img id="carat" src="img/carat.png" /> | ||
Enumerations Reference | ||
</p> | ||
</div> | ||
<div class="content-wrapper"> | ||
<nav class="sidebar"> | ||
<ul class="nav-groups"> | ||
<li class="nav-group-name"> | ||
<a href="Enums.html">Enumerations</a> | ||
<ul class="nav-group-tasks"> | ||
<li class="nav-group-task"> | ||
<a href="Enums/VersionCompareResult.html">VersionCompareResult</a> | ||
</li> | ||
</ul> | ||
</li> | ||
<li class="nav-group-name"> | ||
<a href="Extensions.html">Extensions</a> | ||
<ul class="nav-group-tasks"> | ||
<li class="nav-group-task"> | ||
<a href="Extensions/Bundle.html">Bundle</a> | ||
</li> | ||
<li class="nav-group-task"> | ||
<a href="Extensions/ProcessInfo.html">ProcessInfo</a> | ||
</li> | ||
</ul> | ||
</li> | ||
<li class="nav-group-name"> | ||
<a href="Protocols.html">Protocols</a> | ||
<ul class="nav-group-tasks"> | ||
<li class="nav-group-task"> | ||
<a href="Protocols/SemanticVersionComparable.html">SemanticVersionComparable</a> | ||
</li> | ||
</ul> | ||
</li> | ||
<li class="nav-group-name"> | ||
<a href="Structs.html">Structures</a> | ||
<ul class="nav-group-tasks"> | ||
<li class="nav-group-task"> | ||
<a href="Structs/Version.html">Version</a> | ||
</li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</nav> | ||
<article class="main-content"> | ||
<section> | ||
<section class="section"> | ||
<h1>Enumerations</h1> | ||
<p>The following enumerations are available globally.</p> | ||
|
||
</section> | ||
<section class="section task-group-section"> | ||
<div class="task-group"> | ||
<ul> | ||
<li class="item"> | ||
<div> | ||
<code> | ||
<a name="/s:19SwiftVersionCompare0bC6ResultO"></a> | ||
<a name="//apple_ref/swift/Enum/VersionCompareResult" class="dashAnchor"></a> | ||
<a class="token" href="#/s:19SwiftVersionCompare0bC6ResultO">VersionCompareResult</a> | ||
</code> | ||
</div> | ||
<div class="height-container"> | ||
<div class="pointer-container"></div> | ||
<section class="section"> | ||
<div class="pointer"></div> | ||
<div class="abstract"> | ||
<p>The severity of an update between versions.</p> | ||
|
||
<a href="Enums/VersionCompareResult.html" class="slightly-smaller">See more</a> | ||
</div> | ||
<div class="declaration"> | ||
<h4>Declaration</h4> | ||
<div class="language"> | ||
<p class="aside-title">Swift</p> | ||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">VersionCompareResult</span></code></pre> | ||
|
||
</div> | ||
</div> | ||
</section> | ||
</div> | ||
</li> | ||
</ul> | ||
</div> | ||
</section> | ||
</section> | ||
<section id="footer"> | ||
<p>© 2021 <a class="link" href="" target="_blank" rel="external"></a>. All rights reserved. (Last updated: 2021-01-07)</p> | ||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.6</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p> | ||
</section> | ||
</article> | ||
</div> | ||
</body> | ||
</div> | ||
</html> |
Oops, something went wrong.