Skip to content

Commit

Permalink
Allowing caching build.
Browse files Browse the repository at this point in the history
  • Loading branch information
RockfordWei committed Dec 1, 2017
1 parent 1fb97ec commit baee39b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
13 changes: 10 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import PackageDescription

#if os(Linux)
import Glibc
#else
import Darwin
#endif
var url = "https://github.com/PerfectlySoft/Perfect-CURL.git"
if let urlenv = getenv("URL_PERFECT_CURL") {
url = String(cString: urlenv)
}
let package = Package(
name: "PerfectSMTP",
dependencies: [
.Package(url: "https://github.com/PerfectlySoft/Perfect-HTTP.git", majorVersion: 3),
.Package(url: "https://github.com/PerfectlySoft/Perfect-CURL.git", majorVersion: 3)
.Package(url: url, majorVersion: 3)
]
)
6 changes: 3 additions & 3 deletions Sources/PerfectSMTP/PerfectSMTP.swift
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ extension String {
/// get the address info from a recipient, i.e, someone@somewhere -> @somewhere
public var emailSuffix: String {
get {
guard let at = self.characters.index(of: "@") else {
guard let at = self.index(of: "@") else {
return self
}//end at
return self[at..<self.endIndex]
Expand All @@ -165,15 +165,15 @@ extension String {
/// extract file name from a full path
public var fileNameWithoutPath: String {
get {
let segments = self.characters.split(separator: "/")
let segments = self.split(separator: "/")
return String(segments[segments.count - 1])
}//end get
}//end fileNameWithoutPath

/// extract file suffix from a file name
public var suffix: String {
get {
let segments = self.characters.split(separator: ".")
let segments = self.split(separator: ".")
return String(segments[segments.count - 1])
}//end get
}//end suffix
Expand Down

0 comments on commit baee39b

Please sign in to comment.