Skip to content

Commit

Permalink
Fixes for Swift 5.0 & Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
finestructure committed Sep 1, 2020
1 parent 9eed21e commit 6d4fda6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Sources/SemanticVersion/SemanticVersion.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ extension SemanticVersion: LosslessStringConvertible {


extension SemanticVersion: Comparable {
public static func < (lhs: Self, rhs: Self) -> Bool {
public static func < (lhs: SemanticVersion, rhs: SemanticVersion) -> Bool {
if lhs.major != rhs.major { return lhs.major < rhs.major }
if lhs.minor != rhs.minor { return lhs.minor < rhs.minor }
if lhs.patch != rhs.patch { return lhs.patch < rhs.patch }
Expand All @@ -57,12 +57,12 @@ extension SemanticVersion: Comparable {


extension SemanticVersion {
public var isStable: Bool { preRelease.isEmpty && build.isEmpty }
public var isPreRelease: Bool { !isStable }
public var isMajorRelease: Bool { isStable && (major > 0 && minor == 0 && patch == 0) }
public var isMinorRelease: Bool { isStable && (minor > 0 && patch == 0) }
public var isPatchRelease: Bool { isStable && patch > 0 }
public var isInitialRelease: Bool { self == .init(0, 0, 0) }
public var isStable: Bool { return preRelease.isEmpty && build.isEmpty }
public var isPreRelease: Bool { return !isStable }
public var isMajorRelease: Bool { return isStable && (major > 0 && minor == 0 && patch == 0) }
public var isMinorRelease: Bool { return isStable && (minor > 0 && patch == 0) }
public var isPatchRelease: Bool { return isStable && patch > 0 }
public var isInitialRelease: Bool { return self == .init(0, 0, 0) }
}


Expand Down
8 changes: 8 additions & 0 deletions Tests/LinuxMain.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//
// File.swift
//
//
// Created by Sven A. Schmidt on 01/09/2020.
//

import Foundation

0 comments on commit 6d4fda6

Please sign in to comment.