Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
mflknr committed Mar 30, 2021
2 parents 5222a26 + a6ab532 commit 912371c
Show file tree
Hide file tree
Showing 32 changed files with 75 additions and 195 deletions.
1 change: 0 additions & 1 deletion .jazzy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ xcodebuild_arguments:
- SwiftVersionCompare.xcodeproj
- -scheme
- SwiftVersionCompare-Package

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
//

public extension SemanticVersionComparable {
/// Compare versions using the `SemVer` ranking system.
///
/// - Note: Build-meta-data have no influence on a version's rank.
static func < (lhs: Self, rhs: Self) -> Bool {
// if versions are identical on major, minor and patch level, compare them lexicographiocally
guard lhs.hasEqualVersionCore(as: rhs) else {
Expand Down Expand Up @@ -61,12 +64,4 @@ public extension SemanticVersionComparable {
// lastly, if number of identifiers of lhs version is lower than rhs version, it ranks lower
return lhspr.count < rhspr.count
}

static func <= (lhs: Self, rhs: Self) -> Bool {
lhs == rhs || lhs < rhs
}

static func >= (lhs: Self, rhs: Self) -> Bool {
lhs == rhs || lhs > rhs
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
//

extension SemanticVersionComparable {
/// Conformance to `Hashable` protocol.
///
/// - Note: Since build-meta-data are not considered in ranking semantic version, it won't be considered
/// here either.
public func hash(into hasher: inout Hasher) {
hasher.combine(major)
hasher.combine(minor)
Expand Down
2 changes: 1 addition & 1 deletion docs/Enums.html
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ <h4>Declaration</h4>
</section>
</section>
<section id="footer">
<p>&copy; 2021 <a class="link" href="" target="_blank" rel="external"></a>. All rights reserved. (Last updated: 2021-03-29)</p>
<p>&copy; 2021 <a class="link" href="" target="_blank" rel="external"></a>. All rights reserved. (Last updated: 2021-03-30)</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>
Expand Down
2 changes: 1 addition & 1 deletion docs/Enums/BuildMetaData.html
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ <h4>Declaration</h4>
</section>
</section>
<section id="footer">
<p>&copy; 2021 <a class="link" href="" target="_blank" rel="external"></a>. All rights reserved. (Last updated: 2021-03-29)</p>
<p>&copy; 2021 <a class="link" href="" target="_blank" rel="external"></a>. All rights reserved. (Last updated: 2021-03-30)</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>
Expand Down
2 changes: 1 addition & 1 deletion docs/Enums/PrereleaseIdentifier.html
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ <h4>Declaration</h4>
</section>
</section>
<section id="footer">
<p>&copy; 2021 <a class="link" href="" target="_blank" rel="external"></a>. All rights reserved. (Last updated: 2021-03-29)</p>
<p>&copy; 2021 <a class="link" href="" target="_blank" rel="external"></a>. All rights reserved. (Last updated: 2021-03-30)</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>
Expand Down
2 changes: 1 addition & 1 deletion docs/Enums/VersionCompareResult.html
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ <h4>Declaration</h4>
</section>
</section>
<section id="footer">
<p>&copy; 2021 <a class="link" href="" target="_blank" rel="external"></a>. All rights reserved. (Last updated: 2021-03-29)</p>
<p>&copy; 2021 <a class="link" href="" target="_blank" rel="external"></a>. All rights reserved. (Last updated: 2021-03-30)</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>
Expand Down
2 changes: 1 addition & 1 deletion docs/Extensions.html
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ <h4>Declaration</h4>
</section>
</section>
<section id="footer">
<p>&copy; 2021 <a class="link" href="" target="_blank" rel="external"></a>. All rights reserved. (Last updated: 2021-03-29)</p>
<p>&copy; 2021 <a class="link" href="" target="_blank" rel="external"></a>. All rights reserved. (Last updated: 2021-03-30)</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>
Expand Down
2 changes: 1 addition & 1 deletion docs/Extensions/Bundle.html
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ <h4>Declaration</h4>
</section>
</section>
<section id="footer">
<p>&copy; 2021 <a class="link" href="" target="_blank" rel="external"></a>. All rights reserved. (Last updated: 2021-03-29)</p>
<p>&copy; 2021 <a class="link" href="" target="_blank" rel="external"></a>. All rights reserved. (Last updated: 2021-03-30)</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>
Expand Down
2 changes: 1 addition & 1 deletion docs/Extensions/ProcessInfo.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ <h4>Declaration</h4>
</section>
</section>
<section id="footer">
<p>&copy; 2021 <a class="link" href="" target="_blank" rel="external"></a>. All rights reserved. (Last updated: 2021-03-29)</p>
<p>&copy; 2021 <a class="link" href="" target="_blank" rel="external"></a>. All rights reserved. (Last updated: 2021-03-30)</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>
Expand Down
2 changes: 1 addition & 1 deletion docs/Protocols.html
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ <h4>Declaration</h4>
</section>
</section>
<section id="footer">
<p>&copy; 2021 <a class="link" href="" target="_blank" rel="external"></a>. All rights reserved. (Last updated: 2021-03-29)</p>
<p>&copy; 2021 <a class="link" href="" target="_blank" rel="external"></a>. All rights reserved. (Last updated: 2021-03-30)</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>
Expand Down
97 changes: 19 additions & 78 deletions docs/Protocols/SemanticVersionComparable.html
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,6 @@ <h4>Declaration</h4>
<a name="//apple_ref/swift/Property/prerelease" class="dashAnchor"></a>
<a class="token" href="#/s:19SwiftVersionCompare08SemanticB10ComparableP10prereleaseSayAA20PrereleaseIdentifierOGSgvp">prerelease</a>
</code>
<span class="declaration-note">
Default implementation
</span>
</div>
<div class="height-container">
<div class="pointer-container"></div>
Expand All @@ -216,10 +213,6 @@ <h4>Declaration</h4>
<div class="abstract">
<p>Pre-release identifier of a version.</p>

</div>
<h4>Default Implementation</h4>
<div class="default_impl abstract">

</div>
<div class="declaration">
<h4>Declaration</h4>
Expand All @@ -239,9 +232,6 @@ <h4>Declaration</h4>
<a name="//apple_ref/swift/Property/build" class="dashAnchor"></a>
<a class="token" href="#/s:19SwiftVersionCompare08SemanticB10ComparableP5buildSayAA13BuildMetaDataOGSgvp">build</a>
</code>
<span class="declaration-note">
Default implementation
</span>
</div>
<div class="height-container">
<div class="pointer-container"></div>
Expand All @@ -250,10 +240,6 @@ <h4>Declaration</h4>
<div class="abstract">
<p>Build-meta-data of a version.</p>

</div>
<h4>Default Implementation</h4>
<div class="default_impl abstract">

</div>
<div class="declaration">
<h4>Declaration</h4>
Expand All @@ -269,9 +255,9 @@ <h4>Declaration</h4>
<li class="item">
<div>
<code>
<a name="/s:SL1loiySbx_xtFZ"></a>
<a name="/s:19SwiftVersionCompare08SemanticB10ComparablePAAE1loiySbx_xtFZ"></a>
<a name="//apple_ref/swift/Method/&lt;(_:_:)" class="dashAnchor"></a>
<a class="token" href="#/s:SL1loiySbx_xtFZ"><(_:<wbr>_:<wbr>)</a>
<a class="token" href="#/s:19SwiftVersionCompare08SemanticB10ComparablePAAE1loiySbx_xtFZ"><(_:<wbr>_:<wbr>)</a>
</code>
<span class="declaration-note">
Extension method
Expand All @@ -282,71 +268,19 @@ <h4>Declaration</h4>
<section class="section">
<div class="pointer"></div>
<div class="abstract">

</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="o">&lt;</span> <span class="p">(</span><span class="nv">lhs</span><span class="p">:</span> <span class="k">Self</span><span class="p">,</span> <span class="nv">rhs</span><span class="p">:</span> <span class="k">Self</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>
<p>Compare versions using the <code>SemVer</code> ranking system.</p>
<div class="aside aside-note">
<p class="aside-title">Note</p>
Build-meta-data have no influence on a version&rsquo;s rank.

</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:SL2leoiySbx_xtFZ"></a>
<a name="//apple_ref/swift/Method/&lt;=(_:_:)" class="dashAnchor"></a>
<a class="token" href="#/s:SL2leoiySbx_xtFZ"><=(_:<wbr>_:<wbr>)</a>
</code>
<span class="declaration-note">
Extension method
</span>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">

</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="o">&lt;=</span> <span class="p">(</span><span class="nv">lhs</span><span class="p">:</span> <span class="k">Self</span><span class="p">,</span> <span class="nv">rhs</span><span class="p">:</span> <span class="k">Self</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>
</div>

</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:SL2geoiySbx_xtFZ"></a>
<a name="//apple_ref/swift/Method/&gt;=(_:_:)" class="dashAnchor"></a>
<a class="token" href="#/s:SL2geoiySbx_xtFZ">>=(_:<wbr>_:<wbr>)</a>
</code>
<span class="declaration-note">
Extension method
</span>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">

</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="o">&gt;=</span> <span class="p">(</span><span class="nv">lhs</span><span class="p">:</span> <span class="k">Self</span><span class="p">,</span> <span class="nv">rhs</span><span class="p">:</span> <span class="k">Self</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>
<pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="o">&lt;</span> <span class="p">(</span><span class="nv">lhs</span><span class="p">:</span> <span class="k">Self</span><span class="p">,</span> <span class="nv">rhs</span><span class="p">:</span> <span class="k">Self</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>

</div>
</div>
Expand Down Expand Up @@ -424,9 +358,9 @@ <h4>Return Value</h4>
<li class="item">
<div>
<code>
<a name="/s:SH4hash4intoys6HasherVz_tF"></a>
<a name="/s:19SwiftVersionCompare08SemanticB10ComparablePAAE4hash4intoys6HasherVz_tF"></a>
<a name="//apple_ref/swift/Method/hash(into:)" class="dashAnchor"></a>
<a class="token" href="#/s:SH4hash4intoys6HasherVz_tF">hash(into:<wbr>)</a>
<a class="token" href="#/s:19SwiftVersionCompare08SemanticB10ComparablePAAE4hash4intoys6HasherVz_tF">hash(into:<wbr>)</a>
</code>
<span class="declaration-note">
Extension method
Expand All @@ -437,7 +371,14 @@ <h4>Return Value</h4>
<section class="section">
<div class="pointer"></div>
<div class="abstract">

<p>Conformance to <code>Hashable</code> protocol.</p>
<div class="aside aside-note">
<p class="aside-title">Note</p>
Since build-meta-data are not considered in ranking semantic version, it won&rsquo;t be considered
here either.

</div>

</div>
<div class="declaration">
<h4>Declaration</h4>
Expand Down Expand Up @@ -777,7 +718,7 @@ <h4>Declaration</h4>
</section>
</section>
<section id="footer">
<p>&copy; 2021 <a class="link" href="" target="_blank" rel="external"></a>. All rights reserved. (Last updated: 2021-03-29)</p>
<p>&copy; 2021 <a class="link" href="" target="_blank" rel="external"></a>. All rights reserved. (Last updated: 2021-03-30)</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>
Expand Down
2 changes: 1 addition & 1 deletion docs/Structs.html
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ <h4>Declaration</h4>
</section>
</section>
<section id="footer">
<p>&copy; 2021 <a class="link" href="" target="_blank" rel="external"></a>. All rights reserved. (Last updated: 2021-03-29)</p>
<p>&copy; 2021 <a class="link" href="" target="_blank" rel="external"></a>. All rights reserved. (Last updated: 2021-03-30)</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>
Expand Down
2 changes: 1 addition & 1 deletion docs/Structs/Version.html
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ <h4>Declaration</h4>
</section>
</section>
<section id="footer">
<p>&copy; 2021 <a class="link" href="" target="_blank" rel="external"></a>. All rights reserved. (Last updated: 2021-03-29)</p>
<p>&copy; 2021 <a class="link" href="" target="_blank" rel="external"></a>. All rights reserved. (Last updated: 2021-03-30)</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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ <h4>Declaration</h4>
</section>
</section>
<section id="footer">
<p>&copy; 2021 <a class="link" href="" target="_blank" rel="external"></a>. All rights reserved. (Last updated: 2021-03-29)</p>
<p>&copy; 2021 <a class="link" href="" target="_blank" rel="external"></a>. All rights reserved. (Last updated: 2021-03-30)</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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ <h4>Declaration</h4>
</section>
</section>
<section id="footer">
<p>&copy; 2021 <a class="link" href="" target="_blank" rel="external"></a>. All rights reserved. (Last updated: 2021-03-29)</p>
<p>&copy; 2021 <a class="link" href="" target="_blank" rel="external"></a>. All rights reserved. (Last updated: 2021-03-30)</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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ <h4>Declaration</h4>
</section>
</section>
<section id="footer">
<p>&copy; 2021 <a class="link" href="" target="_blank" rel="external"></a>. All rights reserved. (Last updated: 2021-03-29)</p>
<p>&copy; 2021 <a class="link" href="" target="_blank" rel="external"></a>. All rights reserved. (Last updated: 2021-03-30)</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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ <h4>Declaration</h4>
</section>
</section>
<section id="footer">
<p>&copy; 2021 <a class="link" href="" target="_blank" rel="external"></a>. All rights reserved. (Last updated: 2021-03-29)</p>
<p>&copy; 2021 <a class="link" href="" target="_blank" rel="external"></a>. All rights reserved. (Last updated: 2021-03-30)</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>
Expand Down
Loading

0 comments on commit 912371c

Please sign in to comment.